Skip to content

provide add_static_method_to_class via plugins.common #12521

Open
@petergaultney

Description

@petergaultney

Feature

Mypy's plugin helpers provide a few common cases, like adding an attribute and adding a method. I have a working implementation of adding a static method to a class, and as far as I can tell mypy does not currently provide a way of doing this.

Pitch

If a core developer had time to review a PR to introduce add_static_method_to_class to plugins.common, I'd be happy to spend some time figuring out how to contribute my code.

My current working version can be found here: https://github.com/xoeye/typecats/blob/main/typecats/cats_mypy_plugin.py?ts=4#L160

Metadata

Metadata

Assignees

No one assigned

    Labels

    featuretopic-pluginsThe plugin API and ideas for new plugins

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions