[issue26146] PEP 511: Add ast.Constant to allow AST optimizer to emit constants

STINNER Victor report at bugs.python.org
Tue Jan 19 16:30:08 EST 2016


STINNER Victor added the comment:

First I also wanted to add ast.Literal to literals: list, set, dict, etc. But it doesn't work, we loose the item order: set and dict are unordered. An optimizer must not change the order in which items are created. At least, not by default.

I'm talking about an hypothetical ast.Literal type which would take a Python object (list, set, etc.) Current ast.Set contains an ordered list of items, ast.Dict uses two ordered lists for keys and values.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26146>
_______________________________________


More information about the Python-bugs-list mailing list