New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

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.

----------
components: Interpreter Core
messages: 315508
nosy: benjamin.peterson, brett.cannon, inada.naoki, ncoghlan, pitrou, 
rhettinger, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Move folding tuples of constants into compiler.c from peephole.c
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33318>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to