Message315508
Explicit tuples of constants are folded in the AST optimizer since 3.7. But peephole.c still contains the code for folding tuples of constants, because there are tuples created by the compiler. For example "[1, 2, *a]", "f(1, 2, *a)", "def f(a=1, b=2)" all create a tuple (1, 2).
The following PR moves this code from peephole.c into compiler.c. This makes the code a tiny bit clearer, because it works on higher level than a bytecode. An obvious benefit -- the optimization is performed before calculating the depth of the stack, thus it will be more exact. |
|
Date |
User |
Action |
Args |
2018-04-20 12:57:22 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, brett.cannon, rhettinger, ncoghlan, pitrou, benjamin.peterson, methane, yselivanov |
2018-04-20 12:57:21 | serhiy.storchaka | set | messageid: <1524229041.8.0.682650639539.issue33318@psf.upfronthosting.co.za> |
2018-04-20 12:57:21 | serhiy.storchaka | link | issue33318 messages |
2018-04-20 12:57:21 | serhiy.storchaka | create | |
|