[issue44524] __name__ attribute in typing module
Lars van Gemerden
report at bugs.python.org
Tue Jun 29 09:21:19 EDT 2021
Lars van Gemerden <lars at rational-it.com> added the comment:
I was not aware the __name__ attribute is an implementation detail. It is described in the docs: https://docs.python.org/3/reference/datamodel.html.
I have been using it since python 2.7, for example for logging.
The function “split_module_names” is just a function to see what items in a module have and do not have a __name__ attribute; thought it might help proceedings.
If I were to suggest an improvement, it would be that all classes and types (or minimally the abc’s) would have a __name__ attribute, being the name under which it can be imported.
Also that the abc’s in typing and collections are as similar as possible.
----------
nosy: +lars2
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44524>
_______________________________________
More information about the Python-bugs-list
mailing list