pylint-dev / pylint-dev/astroid

Understand mutation of tuples

Open
#88 1 comment 0 reactions 0 assignees View on GitHub
Enhancement ✨
Dominant language
Python
Stars
582
Forks
357
Avg merge
1d 1h
Merged PRs (30d)
23

Description

Originally reported by: **Claudiu Popa (BitBucket: [PCManticore](http://bitbucket.org/PCManticore), GitHub: @PCManticore)**

---

It would be nice if astroid infers the fact that the tuple has a new value here:

```
#!python

from astroid.builder import AstroidBuilder as ab
node = ab().string_build('''
x = (1, 2)
x+=(2,3)
''')
f = node['x']
print(f.infered()[0].as_string()) # should have 1, 2, 2, 3
```

---
- Bitbucket: https://bitbucket.org/logilab/astroid/issue/88

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reproducer using AstroidBuilder.string_build and node['x'].infered(), then trace how tuple augmented assignment is inferred. The work is done when the example reports the expected tuple value, (1, 2, 2, 3), with a focused regression test if an existing test location is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.