Convert Type Parameters to follow PEP 695 syntax introduced in Python 3.12
Los mantenedores suelen responder en 1 día
@FrancescoPezzella ya está trabajando en esto.
Desde el 14/10/2026.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- developer-experience
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 4.2k
- Forks
- 1.5k
- Merge medio
- 2 d 21 h
- PR fusionados (30 d)
- 74
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pydata/xarray
-
xarray removes axis grid from pcolormeshPosiblemente ocupada @Sealdot la tomó hoy. Abiertobug needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
`DataTree.map_over_datasets` behavior can be obscure sometimesPosiblemente ocupada @mohansree14 la tomó hace 24 días. Abiertoneeds triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pydata/xarray#11813 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Comparing attrs that contain a dict of NumPy arrays raises ValueError in identical / assert_identicalPosiblemente ocupada @SohamXYZDev la tomó hace 29 días. Abiertobug needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
pydata/xarray#11777 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
RangeIndex` with datetime64 bounds cannot be printed (`Unknown format code 'g'`)Posiblemente ocupada @d-chambers la tomó hace 60 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pydata/xarray#11598 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
DataTree constructor error message says dict even though dict is not acceptedPosiblemente ocupada @aryansk la tomó hace 100 días. Abiertobug contrib-good-first-issue topic-DataTree topic-error reporting
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pydata/xarray#11514 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de pydata/xarray
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
abetlen/llama-cpp-python#2424 ·
Los mantenedores suelen responder en 1 día
-
Bug IronPython Python 3
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pyrevitlabs/pyRevit#4184 ·
Los mantenedores suelen responder en 1 día
-
CLAW (Agents & Orchestration)Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
jqueryscript/awesome-claude-code#1009 ·
-
tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día