You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should determine if t is meaningful to use in an isinstance check.
We've got some code in 3.6 that was simply doing:
isinstance(t, type)
for this purpose. It worked. typing.List as well as all your basic types passed correctly.
It blows up in 3.7 onwards because the type of typing.List and friends has changed from type to typing._GenericAlias or typing._SpecialGenericAlias.
Not having a simple way to answer the question of is something is a type that is meaningfully usable for isinstance checks from other things is frustrating. (I'd argue that such a basic thing should even go in the Python stdlib, but this module may be the best playground for that to start in)
The text was updated successfully, but these errors were encountered:
It should determine if
t
is meaningful to use in anisinstance
check.We've got some code in 3.6 that was simply doing:
isinstance(t, type)
for this purpose. It worked.
typing.List
as well as all your basic types passed correctly.It blows up in 3.7 onwards because the type of
typing.List
and friends has changed fromtype
totyping._GenericAlias
ortyping._SpecialGenericAlias
.Not having a simple way to answer the question of is something is a type that is meaningfully usable for isinstance checks from other things is frustrating. (I'd argue that such a basic thing should even go in the Python stdlib, but this module may be the best playground for that to start in)
The text was updated successfully, but these errors were encountered: