> From my understanding, _Py_IDENTIFIER was designed for static usage.
> The overhead is quite low; keeping it as a private (static)
> module-level internal variable helps to decouple things.

I understand the importance of decoupling in general, but meanings of __name__, 
__dict__ etc. aren't going to change. What practical difficulties (in terms of 
coupling) do you foresee if e.g. all C modules know that somewhere there is a 
constant value representing the constant string "__dict__", and so on? There's 
no suggestion that some C modules will use a different constant string value to 
refer to e.g. the "__dict__" attribute than other C modules, is there? I'm not 
suggesting that all _Py_IDENTIFIERs need to be extern, just the ones whose 
meanings are public and can't be changed.

I'm not coming from a worried-about-the-memory-overhead perspective - it's more 
about the manageability of ad hoc static variables which can be "considered 
harmful" in certain scenarios - such as sub-interpreters, for example. 
_Py_IDENTIFIER seems to account for a fair proportion of all static variable 
declarations.

> This target is very important for keeping public API as small as possible.

I'm not suggesting that _Py_IDENTIFIERs become part of the public API. Surely 
it's not the case that any and every extern identifier becomes part of the 
public API? (I know people can misuse things and use unsupported internal APIs, 
but then they're on their own, right?)

Regards,

Vinay Sajip
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/ZTLSGAHCKHLQK5BBKYHLEQGJHCU4OAFB/

Reply via email to