[issue44524] __name__ attribute in typing module

Łukasz Langa report at bugs.python.org
Fri Aug 6 08:48:03 EDT 2021


Łukasz Langa <lukasz at langa.pl> added the comment:

Serhiy, good question. As builtin generics return the base `__name__` for subscribed version, it makes sense to do the same for the versions in `typing`, especially if their unsubscribed versions provide `__name__`.

As to "why even have `__name__` in the first place?", it's for introspection purposes.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44524>
_______________________________________


More information about the Python-bugs-list mailing list