Author serhiy.storchaka
Recipients benjamin.peterson, brett.cannon, methane, ncoghlan, pitrou, rhettinger, serhiy.storchaka, yselivanov
Date 2018-04-20.12:57:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524229041.8.0.682650639539.issue33318@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-04-20 12:57:22serhiy.storchakasetrecipients: + serhiy.storchaka, brett.cannon, rhettinger, ncoghlan, pitrou, benjamin.peterson, methane, yselivanov
2018-04-20 12:57:21serhiy.storchakasetmessageid: <1524229041.8.0.682650639539.issue33318@psf.upfronthosting.co.za>
2018-04-20 12:57:21serhiy.storchakalinkissue33318 messages
2018-04-20 12:57:21serhiy.storchakacreate