mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
gh-131738: optimize builtin any/all/tuple calls with a generator expression arg (#131737)
This commit is contained in:
parent
674dbf3b3a
commit
2c8f329dc6
16 changed files with 199 additions and 38 deletions
|
@ -9,6 +9,7 @@ __all__ = ["cmp_op", "stack_effect", "hascompare", "opname", "opmap",
|
|||
"HAVE_ARGUMENT", "EXTENDED_ARG", "hasarg", "hasconst", "hasname",
|
||||
"hasjump", "hasjrel", "hasjabs", "hasfree", "haslocal", "hasexc"]
|
||||
|
||||
import builtins
|
||||
import _opcode
|
||||
from _opcode import stack_effect
|
||||
|
||||
|
@ -38,7 +39,8 @@ hasexc = [op for op in opmap.values() if _opcode.has_exc(op)]
|
|||
_intrinsic_1_descs = _opcode.get_intrinsic1_descs()
|
||||
_intrinsic_2_descs = _opcode.get_intrinsic2_descs()
|
||||
_special_method_names = _opcode.get_special_method_names()
|
||||
_common_constants = [AssertionError, NotImplementedError]
|
||||
_common_constants = [builtins.AssertionError, builtins.NotImplementedError,
|
||||
builtins.tuple, builtins.all, builtins.any]
|
||||
_nb_ops = _opcode.get_nb_ops()
|
||||
|
||||
hascompare = [opmap["COMPARE_OP"]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue