Message376873
The implementation of PEP 585 in 3.9 adds some new attributes, but they aren't listed with dir() (then, not list in autocomplete and IntelliSense).
Python 3.9.0rc1+ (heads/3.9:d7cd1164c1, Aug 25 2020, 17:27:09)
>>> li = list[int]
>>> li.__origin__
<class 'list'>
>>> getattr(li, '__origin__')
<class 'list'>
>>> '__origin__' in dir(li)
False
That applies to:
__origin__
__args__
__parameters__
It seems to be not the expected behaviour, so this bug report. If this is not the case, some piece of documentation could be interesting. Also, I couldn't find anything about Generic Alias in the documentation, only in the source code. Should this be addressed too? |
|
Date |
User |
Action |
Args |
2020-09-14 07:06:06 | AllanDaemon | set | recipients:
+ AllanDaemon, docs@python |
2020-09-14 07:06:06 | AllanDaemon | set | messageid: <1600067166.95.0.710796917701.issue41780@roundup.psfhosted.org> |
2020-09-14 07:06:06 | AllanDaemon | link | issue41780 messages |
2020-09-14 07:06:05 | AllanDaemon | create | |
|