Commit 4cd51b6
committed
Convert list literals to tuples in for-loop iterables
Compile `for x in [a, b, c]:` as `BUILD_TUPLE 3` instead of
`BUILD_LIST 3`, matching CPython's optimization. Also skip
__classdict__ when future annotations are active, and restrict
conditional annotation detection to AnnAssign only.1 parent 0e51ba3 commit 4cd51b6
1 file changed
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1811 | 1811 | | |
1812 | 1812 | | |
1813 | 1813 | | |
1814 | | - | |
1815 | | - | |
| 1814 | + | |
1816 | 1815 | | |
1817 | 1816 | | |
1818 | 1817 | | |
| |||
5458 | 5457 | | |
5459 | 5458 | | |
5460 | 5459 | | |
5461 | | - | |
| 5460 | + | |
| 5461 | + | |
| 5462 | + | |
| 5463 | + | |
| 5464 | + | |
| 5465 | + | |
| 5466 | + | |
| 5467 | + | |
| 5468 | + | |
| 5469 | + | |
| 5470 | + | |
| 5471 | + | |
| 5472 | + | |
| 5473 | + | |
| 5474 | + | |
5462 | 5475 | | |
5463 | 5476 | | |
5464 | 5477 | | |
| |||
0 commit comments