Skip to content

TCH001 Re export x annotation #2684

@g-as

Description

@g-as

When an import is used in an annotation but also is re exported in an __all__ statement, TCH001 rings.

"""Re export x annotation."""
from .stuff import Stuff

__all__ = ("Stuff", "get_stuff")


def get_stuff(x: Stuff) -> None:
    """Get some stuff."""
    ...
__init__.py:2:20: TCH001 Move application import `.stuff.Stuff` into a type-checking block

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions