Skip to content

os.PathLike should be a protocol #2808

@catern

Description

@catern

os.PathLike is a special class which overrides __subclasshook__ so that isinstance(x, os.PathLike) returns true if x has an __fspath__ method.

To achieve equivalent behavior when typechecking, os.PathLike should be treated as a protocol.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions