[issue32525] Empty tuples are not optimized as constant expressions

Raymond Hettinger report at bugs.python.org
Wed Jan 10 13:58:46 EST 2018


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

This looks like it was already fixed in Python 3.7:

$ ./python.exe
Python 3.7.0a3+ (heads/master:7f7de371f9, Jan  6 2018, 21:35:03)
[Clang 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from dis import dis
>>> def f():
...   x = ()
...   y = 2, 4
...
>>> dis(f)
  2           0 LOAD_CONST               1 (())
              2 STORE_FAST               0 (x)

  3           4 LOAD_CONST               2 ((2, 4))
              6 STORE_FAST               1 (y)
              8 LOAD_CONST               0 (None)
             10 RETURN_VALUE

----------
nosy: +rhettinger
resolution:  -> out of date

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32525>
_______________________________________


More information about the Python-bugs-list mailing list