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
{{ message }}
Repository navigation
Confusing error: incompatible type "Type[bytes]"; expected "Type[bytes]" #9756
There's still something strange going on here that the linked issue doesn't fully explain, though surely the implicit promotion has something to do with it. The error doesn't repro with [float, int] or [int, float], even though these are also implicitly promoted, or with [bytearray, bytes].
Activity
hauntsaninja commentedon Nov 25, 2020
Here's a shorter repro:
See python/typing#552 for some more context.
A good workaround here is to use a tuple instead of a list (since tuples are heterogeneous, mypy won't need to perform a join).
JelleZijlstra commentedon Nov 25, 2020
There's still something strange going on here that the linked issue doesn't fully explain, though surely the implicit promotion has something to do with it. The error doesn't repro with
[float, int]or[int, float], even though these are also implicitly promoted, or with[bytearray, bytes].EugeneN commentedon Oct 28, 2022
the error reproduces with arbitrary types, in function arguments, assigning etc
EugeneN commentedon Oct 28, 2022
Argument 3 to "..." has incompatible type "List[PlatformFees]"; expected "List[PlatformFees]" mypy(error)Argument 2 to "..." has incompatible type "CIPSolution"; expected "CIPSolution" mypy(error)Make join of callables a bit more principled (python#22296)