Modernize annotation usage in libregrtest
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PRs
- Métricas de PR pendentes
Descrição
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
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece por Lib/test/libregrtest/results.py e Lib/test/libregrtest/mypy.ini; inspecione a configuração existente de anotações e verificação de tipos e, em seguida, compare a abordagem do pyrepl em gh-149985 e gh-149992. Está concluído quando o lazy annotation import e a runtime annotation são usados sem eager XML imports, e o mypy tem como alvo o Python 3.15.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- testing-qa
- Tipo de issue
- Refatoração
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 30/100