Skip to content

Can't use _typeshed in TYPE_CHECKING block #479

Open
@nineteendo

Description

@nineteendo

Example:

if TYPE_CHECKING:
    from _typeshed import StrPath

def foo(path: StrPath) -> StrPath:
    return path

Output (fails a build on read the docs):

WARNING: Failed guarded type import with ModuleNotFoundError("No module named '_typeshed'")

Stubs for _typeshed: https://github.com/python/typeshed/tree/main/stdlib/_typeshed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions