-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Push correct enclosing class while deferring a method #4073
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
Conversation
I think I am to blame for the name Can't the issue be resolved by freezing the entire scope, as suggested by the Anyway, if you are leaving the method |
It is unnecessary, and will only make solution more complex.
OK, I renamed this variable, I keep however the named tuple attribute name, |
Can you fix the merge conflict? |
Fixed. |
This generates unexpected errors when run against an internal Dropbox codebase. Here is a simplified example: class A:
def f(self) -> None:
def g(x: int) -> int: # Self argument missing for a non-static method
# (or an invalid type for self)
return y
y = int() |
Indeed, since the |
@JukkaL Fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the PR!
Fixes #4069
This pushes the correct enclosing class while deferring a method instead of just the top class.
A related comment: the name
active_class
is a bit misleading, it returnsNone
from within methods, I think it would be more consistent ifactive_class
behave the same way asself.type
in semantic analysis, but it is too late to change this, it is already used in several other places with this semantics.