pylint-dev / pylint-dev/astroid

Understand augmented assignments

Open
#192 0 comments 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)**

---

Closely related to #115.

We should try to understand the various forms of augmented assignments. The simplest case, for instance, causes false positives with numpy.core (which is _fixed_ in astroid through a transform, not the proper fix though)

```
#!python

a = [...]
a += [...]
a += [...]
a # infer with all mutations
```

Since I gave numpy.core as an example, the **all** attribute is computed by adding the **all** values of subimports into this attribute through augmented assignment.

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

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or tests are named. Start with the augmented-assignment example in the issue and compare inference for repeated list mutations, including the numpy.core case; done means the various augmented-assignment forms are understood without relying on the existing astroid transform.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.