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
error: Incompatible return value type (got "zip[tuple[str, object]]", expected "zip[tuple[str, T]] | zip[tuple[str, bool]]") [return-value]
on the return from C.g
Confirmed with mypy 1.11.2 in Python 3.11.9, but does not seem version-specific.
P.S. My specific use case where I found this issue was where I had for (a,b) in zip(x,y), then was using b where Union[T|bool] was expected, and getting an error message from mypy that object (b) is used where T|bool was expected; I tried to simplify that code to digest it to the minimal reproducible example. I do not fully understand all the constraints here, but the fact that f is accepted and C.g is not does suggest to me that something is clearly wrong.
The text was updated successfully, but these errors were encountered:
Bug Report
In the following file
mypy accepts
f
, but complainson the return from
C.g
Confirmed with mypy 1.11.2 in Python 3.11.9, but does not seem version-specific.
P.S. My specific use case where I found this issue was where I had
for (a,b) in zip(x,y)
, then was usingb
whereUnion[T|bool]
was expected, and getting an error message from mypy thatobject
(b
) is used whereT|bool
was expected; I tried to simplify that code to digest it to the minimal reproducible example. I do not fully understand all the constraints here, but the fact thatf
is accepted andC.g
is not does suggest to me that something is clearly wrong.The text was updated successfully, but these errors were encountered: