20.09.19 22:19, Vinay Sajip via Python-Dev пише:
I just ran an analysis of static variable definitions in CPython code, using 
clang, on Ubuntu and Windows. The results should be available here:

https://cpython.red-dove.com/

As I understand it, _Py_IDENTIFIER instances are supposed to hold constant strings that are used in 
Python - e.g. "__class__", "__dict__" and so on. I noticed that there are 
numerous duplicates of these - e.g. 8 instances of __name__, 11 instances of __dict__, and so on - 
each instance is defined as static in its source file and so completely distinct from the others.

Note that corresponding strings are interned, so all _Py_IDENTIFIER(__name__) share the same Python object.

There is also the _PyArg_Parser structure which contains reference to the lazy initialized tuple of strings.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/ZYQBFVDXPAVVGSA6O4MXZ5ADAZU4Q37T/

Reply via email to