[issue29369] Use Py_IDENTIFIER in Python-ast.c

STINNER Victor report at bugs.python.org
Wed Jan 25 10:04:20 EST 2017


STINNER Victor added the comment:

> The three identifiers are used in type.  Dozen (100+) types using them.

I tried once to put *all* (most common) _Py_IDENTIFIER() in a single file and share them, but I abandoned my attempt:

http://bugs.python.org/issue19515#msg202385
Antoine Pitrou: "Well, then IMHO it's not worth it."

See issues #19512 and #19515.


"""
>>> import _ast
>>> _ast.Dict.__dict__
mappingproxy({'_fields': ('keys', 'values'), '__module__': '_ast', '__doc__': None})
"""

But the _ast module is not imported by default, only in programs importing "ast" explicitly.

Well, I'm not opposed to the change, I'm just trying to understand how the code is used ;-)

----------

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


More information about the Python-bugs-list mailing list