Skip to content

FEAT: Add -> None to any typed __init__() #2913

@NickCrews

Description

@NickCrews

Is your feature request related to a problem? Please describe.

In pandas-dev/pandas#46279 someone wants to make the pandas codebase adhere to PEP484, so they add None return annotations to some __init__ methods. This is a bummer that this is manual. It would be nice if this could be included in pandas's code checks in CI, so the entire code base was consistent.

Describe the solution you'd like

It would be nice if black added this annotation automatically. However, it should only happen for methods that already have type annotations: black should not make a previously-untyped method suddenly be typed, because that will cause some type checkers like mypy to inspect it, and perhaps it was left untyped on purpose.

Describe alternatives you've considered

Not sure if this belongs here, or in another project like flake8, etc, or if this is even within scope. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions