This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kj
Recipients JelleZijlstra, farcat, gvanrossum, kj, lars2
Date 2021-06-29.14:03:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Lars, yes you're right that __name__ is documented in datamodel, sorry I wasn't clear in my original message. What I meant was that specifically for the typing module, it's not exposed anywhere in its docs

> 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. 

I think this makes sense. It should be as simple as adding self.__name__ = name or some variant. Note that some types hack their names, such as TypeVar or ParamSpec. So it's not always that __name__ ​== type/class name.

> Also that the abc’s in typing and collections are as similar as possible.
We strive towards this but it's difficult to get it 100%. The abcs in typing are implemented in pure Python and alias the ones in collections, while the ones in collections are sometimes tied to C. AFAIK, most types in typing only do what the PEPs promise. I hope you understand.
Date User Action Args
2021-06-29 14:03:34kjsetrecipients: + kj, gvanrossum, farcat, JelleZijlstra, lars2
2021-06-29 14:03:34kjsetmessageid: <>
2021-06-29 14:03:34kjlinkissue44524 messages
2021-06-29 14:03:34kjcreate