Modernize annotation usage in libregrtest
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
Bug description:
Lib/test/libregrtest/results.py imports TYPE_CHECKING only to guard a type-only import:
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from xml.etree.ElementTree import Element
Now that explicit lazy imports are available, this can be replaced with:
lazy from xml.etree.ElementTree import Element
The stringized list['Element'] annotation can then become list[Element]. This keeps xml.etree.ElementTree from being imported eagerly while making the annotation name available at runtime.
Lib/test/libregrtest/mypy.ini should also target Python 3.15, following the approach used for pyrepl in gh-149985 and gh-149992.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-156403
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.
Línea de trabajo
Empieza por Lib/test/libregrtest/results.py y Lib/test/libregrtest/mypy.ini; inspecciona la configuración existente de anotaciones y comprobación de tipos, y después compara el enfoque de pyrepl en gh-149985 y gh-149992. Se considera terminado cuando se utilizan el lazy annotation import y la runtime annotation sin eager XML imports, y mypy tiene como objetivo Python 3.15.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- testing-qa
- Tipo de issue
- Refactorización
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 30/100