[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-26 Thread Martin Rueckl
Martin Rueckl added the comment: Just my two cents as a new contributor but long time user: - isinstance(list[int], type) returning False seems incredibly un-intuitive to me. I always see generics (e.g. list without type parameter) as higher kinded types, where passing a type argument via

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-25 Thread Martin Rueckl
Martin Rueckl added the comment: Can confirm for 3.9.7 as well. -- nosy: +martinitus ___ Python tracker <https://bugs.python.org/issue45438> ___ ___ Python-bug

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-25 Thread Martin Rueckl
Change by Martin Rueckl : -- keywords: +patch pull_requests: +27476 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29212 ___ Python tracker <https://bugs.python.org/issu

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-25 Thread Martin Rueckl
Martin Rueckl added the comment: I just created a PR and signed the contributor agreement. Waiting for it to update :-) Comments welcome! -- ___ Python tracker <https://bugs.python.org/issue45

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

2021-11-01 Thread Martin Rueckl
Martin Rueckl added the comment: One thing that probably should be considered in this context: isinstance(arg, type) == issubclass(type(arg), type) Holds True for arg in (Optional[X], Union[X, Y]). Both sides evaluate to False. (v3.10.0) While I still think both sides evaluating to True

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

2021-11-01 Thread Martin Rueckl
Martin Rueckl added the comment: Sorry for the noise: - Literal['a', 'b'], - TypeVar('T') Behave like Optional/Union -- ___ Python tracker <https://bugs.python.org/issue45