python / python/typeshed

PEP 695 (Type Parameter Syntax) tracker - Generics

Open
#10,869 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

project: feature tracker
Dominant language
Python
Stars
5.1k
Forks
2.1k
Avg merge
1d 19h
Merged PRs (30d)
82

Description

This issue is supposed to track when we can start to use the improved generics syntax introduced in Python 3.12 (PEP 695 in typeshed. Support is needed in released versions of:

  • mypy
  • pytype (optional)
  • pyright
  • PyCharm (optional)

As this is a syntax change, it's unlikely that we can add support before mypy drops support for running under Python 3.11 and below.

Example from the PEP:

class ClassA[T: str]:
    def method1(self) -> T:
        ...

def func[T](a: T, b: T) -> T:
    ...

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 with PEP 695 and verify the released-version support status of mypy, pytype, pyright, and PyCharm. The tracker is done when the relevant tools support the syntax in typeshed and the corresponding checklist entries can be updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.