Skip to content
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

Fix accessing unannotated implicit class methods #7739

Merged
merged 3 commits into from Oct 20, 2019

Conversation

@ilevkivskyi
Copy link
Collaborator

ilevkivskyi commented Oct 17, 2019

Fixes #7735

The fix is quite straightforward, this was not triggered before because all common cases go trough other code paths.

@JukkaL
JukkaL approved these changes Oct 17, 2019
Copy link
Collaborator

JukkaL left a comment

Thanks for the quick fix!

@msullivan Is this important enough to warrant a bugfix release?

@@ -428,6 +430,11 @@ def callable_type(fdef: FuncItem, fallback: Instance,
column=fdef.column,
implicit=True,
)
if no_self and typ.arg_types:
typ = typ.copy_modified(arg_types=typ.arg_types[1:],

This comment has been minimized.

Copy link
@JukkaL

JukkaL Oct 17, 2019

Collaborator

Can we use bind_self here?

This comment has been minimized.

Copy link
@ilevkivskyi

ilevkivskyi Oct 20, 2019

Author Collaborator

At first look it seemed to me bind_self may not work, but now it looks OK to add it in the caller, I will now try to do this. Even if we will discover it doesn't work sometimes, we just need to fix it so it works with unannotated methods.

@msullivan

This comment has been minimized.

Copy link
Collaborator

msullivan commented Oct 17, 2019

I'm going to wait another day, see if anything else shakes out, and make a call then.

@ilevkivskyi ilevkivskyi merged commit ad85bc5 into python:master Oct 20, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ilevkivskyi ilevkivskyi deleted the ilevkivskyi:another-init-subclass-fix branch Oct 20, 2019
ilevkivskyi added a commit that referenced this pull request Oct 21, 2019
This PR fixes an obvious typo (currently `is_classmethod` is not passed to a nested call). I noticed this while working on #7739
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.