Skip to content

Type hints for pathlib.types #130798

Open
Open
@barneygale

Description

@barneygale

Feature or enhancement

The pathlib.types module is new in 3.14, and contains a single public class: pathlib.types.PathInfo.

This module also contains a few private classes: _PathParser, _JoinablePath, _ReadablePath and _WritablePath.

As the pathlib.types module is not imported by pathlib, I think we're free to add proper type annotations to the entire module, including the private classes. I think this will help clarify the interface.

I'd like these hints to be compatible with the oldest version of Python still receiving security updates (3.9 at time of writing) because I'm hoping to provide a PyPI package from this module.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions