Message376940
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? |
|
Date |
User |
Action |
Args |
2020-09-15 14:19:52 | BTaskaya | set | recipients:
+ BTaskaya, gvanrossum, docs@python, AllanDaemon |
2020-09-15 14:19:52 | BTaskaya | set | messageid: <1600179592.11.0.905673974672.issue41780@roundup.psfhosted.org> |
2020-09-15 14:19:52 | BTaskaya | link | issue41780 messages |
2020-09-15 14:19:52 | BTaskaya | create | |
|