-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn Return Any now applies to small lambdas #9656
Comments
Thanks for posting your repro! The thing that's changed between 0.782 and 0.790 is the definition of I agree that I'm not sure to what extent this is intentional, but a) I agree it's kind of annoying, b) as #9590 points out, we don't get the error when aliasing the lambda. |
Bug Report
Suppose we have the follow code:
With
mypy 0.790
, I get an error:With
mypy 0.782
, this passes:I'm not actually sure that this is a bug or whether this is an intended feature -- I could see it either way. On one hand, this is technically a case where we are returning any, so warning on this follows the flag name. OTOH though, lambdas are often used for small things where it'd be syntactically cumbersome to add
cast
s.Your Environment
--warn-return-any
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: