python / python/cpython

Type hints for `pathlib.types`

Open
#130,798 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib topic-pathlib topic-typing type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

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
  • gh-131639

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the pathlib.types module and linked PR gh-131639 to determine the current state of the work. Check how annotations can remain compatible with Python 3.9, and consider the public and private classes named in the issue. Done means the module has complete, compatible type hints without changing its intended interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.