Martin Rueckl added the comment:
Sorry for the noise:
- Literal['a', 'b'],
- TypeVar('T')
Behave like Optional/Union
--
___
Python tracker
<h
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
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
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
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
Martin Rueckl added the comment:
Can confirm for 3.9.7 as well.
--
nosy: +martinitus
___
Python tracker
<https://bugs.python.org/issue45438>
___
___
Python-bug