]> granicus.if.org Git - python/commit
bpo-29469: peephole: Remove const_stack (GH-4879)
authorINADA Naoki <methane@users.noreply.github.com>
Mon, 18 Dec 2017 06:52:54 +0000 (15:52 +0900)
committerGitHub <noreply@github.com>
Mon, 18 Dec 2017 06:52:54 +0000 (15:52 +0900)
commit87010e85cb37192d63b1a30e5fabba307ad5a3f5
tree166197c11581f9a9ede1c4c734716f3892683e64
parent902ab80b590e474bb2077b1fae8aac497b856d66
bpo-29469: peephole: Remove const_stack (GH-4879)

Constant folding was moved to AST optimizer.
But compiler may emit LOAD_CONSTs + BUILD_TUPLE.
For example, default arguments can be constant tuple
if all arguments are constant.

This commit makes peephole's tuple folding simple.
It doesn't support nested tuples because nested
tuples are folded by AST optimizer already.
Python/peephole.c