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 seems that the below combination of *args, and TypeVar with constraints related to Type, is misbehaving. I reached out on the Gitter and was instructed that this is probably a bug.
I tried replacing the Types with ints (observable in the linked mypy-playground) and that seems to work fine.
To Reproduce
fromtypingimportTypeVar, List, TypeTypeArgT=TypeVar("TypeArgT", Type, List[Type])
deftype_a(*args: TypeArgT):
...
deftype_b(*args: List[Type]):
...
type_a(int, str, float) # test t1type_a([str, float], [int]) # test t2 <-- this does not worktype_b([bool, bool], [str, bool]) # test t3
Bug Report
It seems that the below combination of
*args
, andTypeVar
with constraints related toType
, is misbehaving. I reached out on the Gitter and was instructed that this is probably a bug.I tried replacing the
Type
s withint
s (observable in the linked mypy-playground) and that seems to work fine.To Reproduce
https://mypy-play.net/?mypy=0.780&python=3.8&gist=847224369f6bad4d74a1ccfd672fb250
Actual Behavior
Test
t2
in the above snippet throws the following mypy error:Your Environment
The text was updated successfully, but these errors were encountered: