Message394950
PEP 585 has the side-effect of making `list[int]` an instance of `type`. This is not the case for other generic aliases.
It also implies that `inspect.isclass(list[int]) is True`, while `list[int]` is not a class; as a proof of this statement `issubclass(list[int], collections.abc.Collection)` raises `TypeError: issubclass() arg 1 must be a class`.
By the way, there is the awkward thing of having `isinstance(list[int], type) is True` while `issubclass(type(list[int]), type) is False`. |
|
Date |
User |
Action |
Args |
2021-06-02 22:26:01 | joperez | set | recipients:
+ joperez |
2021-06-02 22:26:01 | joperez | set | messageid: <1622672761.68.0.195869463104.issue44293@roundup.psfhosted.org> |
2021-06-02 22:26:01 | joperez | link | issue44293 messages |
2021-06-02 22:26:01 | joperez | create | |
|