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

Support classes and type aliases in plugin hooks #5379

Merged
merged 1 commit into from Jul 25, 2018

Conversation

Projects
None yet
2 participants
@ilevkivskyi
Collaborator

ilevkivskyi commented Jul 20, 2018

A step towards #4964

This only solves a small part of the problem that currently blocks progress in several plugins.

This PR adds basic support for class instantiation (including via aliases) in plugins. The proposed simple convention is that get_function_hook is called with the class qualified name.

We might also consider falling back to get_method_hook with __init__ qualified name, if the above returns None, and then to __new__.

cc: @dgelessus

@ilevkivskyi ilevkivskyi requested a review from gvanrossum Jul 20, 2018

@gvanrossum

LG! And thanks for putting a complete example of a plugin in there.

@gvanrossum gvanrossum merged commit 25ab61b into python:master Jul 25, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment