Skip to content

Can't use _typeshed in TYPE_CHECKING block #479

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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