Skip to content

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

Open

Description

@freundTech

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.

Activity

  1. changed the title [-]Add a plugin hook for hadling function/method decorators[/-] [+]Add a plugin hook for handling function/method decorators[/+] on Jan 16, 2021
  2. added
    topic-plugins
    on Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featuretopic-plugins

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions