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 joperez
Recipients joperez
Date 2021-06-02.22:26:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1622672761.68.0.195869463104.issue44293@roundup.psfhosted.org>
In-reply-to
Content
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`.
History
Date User Action Args
2021-06-02 22:26:01joperezsetrecipients: + joperez
2021-06-02 22:26:01joperezsetmessageid: <1622672761.68.0.195869463104.issue44293@roundup.psfhosted.org>
2021-06-02 22:26:01joperezlinkissue44293 messages
2021-06-02 22:26:01joperezcreate