[issue45665] Problems caused by isinstance(list[int], type) returning True

Guido van Rossum report at bugs.python.org
Fri Dec 24 23:55:58 EST 2021


Guido van Rossum <guido at python.org> added the comment:

See https://github.com/python/mypy/issues/9773#issuecomment-1000975000. I may have talked myself into agreeing with Serhiy there! It does seem inconsistent that Any is not considered a type but list[int] is:

>>> isinstance(list[int], type)
True
>>> import typing
>>> isinstance(typing.Any, type)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45665>
_______________________________________


More information about the Python-bugs-list mailing list