Skip to content

Fix self-types in access to overloaded class methods on instances #7937

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

Merged
merged 1 commit into from
Nov 12, 2019

Conversation

ilevkivskyi
Copy link
Member

Fixes #7926

The fix is straightforward, pass is_classmethod where it should be. Also wrap self argument in Type[...] only once, not on every iteration over overload items.

Copy link
Collaborator

@msullivan msullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks for the quick fix

signature = check_self_arg(signature, dispatched_type, False, mx.context,
name, mx.msg)
signature = bind_self(signature, mx.self_type)
signature = check_self_arg(signature, dispatched_type, method.is_class,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops.

@ilevkivskyi ilevkivskyi merged commit 3f8d7e9 into python:master Nov 12, 2019
@ilevkivskyi ilevkivskyi deleted the fix-overloaded-class-method branch November 12, 2019 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression involving overloaded classmethods
2 participants