Commit b4986aa
authored
fix(b909): Fix false positive affecting containers of mutables (#469)
* fix(b909): Fix false positive affecting containers of mutables
The false positives occurred when trying to edit a dictionary while
iterating over a list of dictionaries:
```
lst: list[dict] = [{}, {}, {}]
for dic in lst:
dic["key"] = False # was false positive - fixed now
```
* fix(b909): Allow mutation of dict[key] form
These changes allow the following:
```
some_dict = {"foo": "bar"}
for key in some_dict:
some_dict[key] = 3 # no error (previously error'd)
```
* fix(b909): Fix python 3.8 incompatibility
Turns out, that the slice type was changed in python 3.9.
> Changed in version 3.9: Simple indices are represented by their value,
> extended slices are represented as tuples.
from https://docs.python.org/3/library/ast.html#module-ast1 parent b9f9dce commit b4986aa
2 files changed
+73
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1581 | 1581 | | |
1582 | 1582 | | |
1583 | 1583 | | |
| 1584 | + | |
1584 | 1585 | | |
1585 | 1586 | | |
| 1587 | + | |
1586 | 1588 | | |
1587 | 1589 | | |
1588 | | - | |
| 1590 | + | |
1589 | 1591 | | |
1590 | 1592 | | |
1591 | 1593 | | |
| |||
1603 | 1605 | | |
1604 | 1606 | | |
1605 | 1607 | | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
1606 | 1648 | | |
1607 | 1649 | | |
1608 | 1650 | | |
| |||
1624 | 1666 | | |
1625 | 1667 | | |
1626 | 1668 | | |
1627 | | - | |
| 1669 | + | |
1628 | 1670 | | |
| 1671 | + | |
1629 | 1672 | | |
1630 | 1673 | | |
1631 | 1674 | | |
1632 | 1675 | | |
1633 | 1676 | | |
1634 | | - | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
1635 | 1682 | | |
1636 | 1683 | | |
1637 | 1684 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
0 commit comments