Convert Type Parameters to follow PEP 695 syntax introduced in Python 3.12
Maintainers usually reply within 1 day
@FrancescoPezzella is already working on this.
Since Oct 14, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- developer-experience
Research direction
The issue gives one example: a pipe method with overloads that uses module-level TypeVar and ParamSpec declarations, in a file over 1000 lines. Before editing, check the project's minimum supported Python version and read the three comments to see whether maintainers have agreed to adopt PEP 695 syntax. Done would mean one module converted, its type checker passing, and any remaining TypeVar uses (such as covariant ones) explained.
Written by the indexing model from the issue text.
Description
What is your issue?
Background
https://peps.python.org/pep-0695/ introduced new syntax for Type Parameters.
Out of interest, I took a quick look through the project due to another project I am working on and noticed that this project uses Python 3.12, but still uses a mix of syntax introduced in 3.5 (for reference: https://peps.python.org/pep-0484/) and 3.12, instead of fully modernizing the syntax (where it can be safely done) to the new one.
Sometimes a change cannot be done, for example, if a TypeVar declares covariance/contravariance in a Generic class, since these cases are handled automatically in Python 3.12, and there is no new way to define with the modern syntax.
Example
Old Syntax
from typing import (
...
ParamSpec,
TypeVar,
...
)
T_Resample = TypeVar("T_Resample", bound="Resample")
C = TypeVar("C")
T = TypeVar("T")
P = ParamSpec("P")
@overload
def pipe(
self,
func: Callable[Concatenate[Self, P], T],
*args: P.args,
**kwargs: P.kwargs,
) -> T: ...
@overload
def pipe(
self,
func: tuple[Callable[..., T], str],
*args: Any,
**kwargs: Any,
) -> T: ...
def pipe(
self,
func: Callable[Concatenate[Self, P], T] | tuple[Callable[P, T], str],
*args: P.args,
**kwargs: P.kwargs,
This is a perfect example, where the code could greatly benefit from the new syntax. The file is over a 1000 lines long, the Type Variables are not used anywhere else nor exported. The new syntax would greatly simplify them. This follows Python conventions.
With the new syntax
@overload
def pipe[T, P**](
self,
func: Callable[Concatenate[Self, P], T],
*args: P.args,
**kwargs: P.kwargs,
) -> T: ...
@overload
def pipe[T](
self,
func: tuple[Callable[..., T], str],
*args: Any,
**kwargs: Any,
) -> T: ...
def pipe[T, P**](
self,
func: Callable[Concatenate[Self, P], T] | tuple[Callable[P, T], str],
*args: P.args,
**kwargs: P.kwargs,
This is just one example. I am still looking into this just as interesting case study regarding my research. If this is something that the developers are interested in, I would be happy to look into it more, investigate each case and propose a change with a tool that I am still developing.
Let me know if you would further information, I am quite to making issues and contributions, so I tried my best to follow some examples I read here.
No AI was used in the writing of this.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.5k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 74
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pydata/xarray
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
`DataTree.map_over_datasets` behavior can be obscure sometimesPossibly taken @mohansree14 claimed this 23 days ago. Openneeds triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pydata/xarray#11813 · 1 comment ·
Maintainers usually reply within 1 day
-
Comparing attrs that contain a dict of NumPy arrays raises ValueError in identical / assert_identicalPossibly taken @SohamXYZDev claimed this 29 days ago. Openbug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
pydata/xarray#11777 · 1 comment ·
Maintainers usually reply within 1 day
-
RangeIndex` with datetime64 bounds cannot be printed (`Unknown format code 'g'`)Possibly taken @d-chambers claimed this 60 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pydata/xarray#11598 · 3 comments ·
Maintainers usually reply within 1 day
-
DataTree constructor error message says dict even though dict is not acceptedPossibly taken @aryansk claimed this 100 days ago. Openbug contrib-good-first-issue topic-DataTree topic-error reporting
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pydata/xarray#11514 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
tests
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[Plugin] 群聊记忆 · 人格养成Open
Difficulty 1/5 1-3 hours Newbie friendliness 74/100
-
bug maintainer-managed
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
awslabs/visual-asset-management-system#1759 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100