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
[1.16 regression] assigning a lambda to subclass w/ generics #19165
This works without error in 1.15 mypy. But in the new 1.16 version, one would see Incompatible return value type (got "int", expected "T") on converter2
Your Environment
Mypy version used: 1.16
Mypy command-line flags: (defaults)
Mypy configuration options from mypy.ini (and other config files): n/a
changed the title [-]'Incompatible return value type (... expected "T")' when assigning a lambda to a class w/ generics[/-][+][1.16 regression] assigning a lambda to subclass w/ generics[/+]on May 29, 2025
Oh well, this is fixed on master now by #18943. I am not sure however if it is worth including in a point release, as this is a big PR and regression doesn't seem urgent. Anyway, I will leave this decision up to @JukkaL
Activity
[-]'Incompatible return value type (... expected "T")' when assigning a lambda to a class w/ generics[/-][+][1.16 regression] assigning a lambda to subclass w/ generics[/+]hauntsaninja commentedon May 29, 2025
This will be #18847
ilevkivskyi commentedon May 30, 2025
I will take a look at this (hopefully during weekend). Most likely I just missed some edge case (since it works for non-lambda overrides).
ilevkivskyi commentedon May 31, 2025
Oh well, this is fixed on master now by #18943. I am not sure however if it is worth including in a point release, as this is a big PR and regression doesn't seem urgent. Anyway, I will leave this decision up to @JukkaL
Redoubts commentedon May 31, 2025
Since there’s an obvious workaround, I’m not too pressed about letting this float to the next real release