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 BTaskaya
Recipients AllanDaemon, BTaskaya, docs@python, gvanrossum
Date 2020-09-15.14:19:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600179592.11.0.905673974672.issue41780@roundup.psfhosted.org>
In-reply-to
Content
Okay, so IIRC if we stop forwarding __class__ (add it as an exception to attr_exceptions) it would return us the original dir(), and also solve the inconsistency of the example you gave;

> >>> list.__class__
> <class 'type'>
> >>> list[int].__class__
> <class 'type'>
>
> >>> type(list)
> <class 'type'>
> >>> type(list[int])
> <class 'types.GenericAlias'>

but the problem is that, it is not 'exactly' complying with the specs at PEP 585. I am aware that we already added some extras to this list (https://www.python.org/dev/peps/pep-0585/#parameters-to-generics-are-available-at-runtime) like __mro_entries__ etc, but __class__ looks like a tricky problem. @gvanrossum any comments?
History
Date User Action Args
2020-09-15 14:19:52BTaskayasetrecipients: + BTaskaya, gvanrossum, docs@python, AllanDaemon
2020-09-15 14:19:52BTaskayasetmessageid: <1600179592.11.0.905673974672.issue41780@roundup.psfhosted.org>
2020-09-15 14:19:52BTaskayalinkissue41780 messages
2020-09-15 14:19:52BTaskayacreate