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

Add a plugin hook for handling function/method decorators #9915

Open
freundTech opened this issue Jan 16, 2021 · 0 comments · May be fixed by #9925
Open

Add a plugin hook for handling function/method decorators #9915

freundTech opened this issue Jan 16, 2021 · 0 comments · May be fixed by #9925
Labels
feature topic-plugins The plugin API and ideas for new plugins

Comments

@freundTech
Copy link
Contributor

Feature

mypy currently has the get_class_decorator_hook plugin hook. I want to propose adding a get_function_decorator_hook and get_method_decorator_hook.

Pitch

Adding these hooks would allow special handling of decorated functions, as would for example be required to solve #9911 using a plugin. mypy currently has special handling for a few decorated such as builtins.property, typing.final and more, but from what I can see it's currently not possible to add additional cases using a plugin.

I have already experimented with this a bit and could probably open a PR in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature topic-plugins The plugin API and ideas for new plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants