Support for `__builtins__.pyi`?
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 20.6k
- Forks
- 3.3k
- Merge medio
- 1 d 18 h
- PR fusionados (30 d)
- 54
Descripción
Feature
In #12860 @erictraut said:
We decided to support this in pyright through the use of a specially-named builtins.pyi stub file. If a stub with this name is found within the root directory of a project, pyright treats any symbols declared within that stub as though they are appended to the bottom of builtins.pyi.
and @AlexWaygood closed the issue saying:
if anybody wants to request a mypy equivalent of the more limited feature Eric's introduced over at pyright, they can open another issue to do so.
I would like to request a mypy version of this feature, so that custom Python distributions that provide extra builtins can ship type definitions that are understood by mypy. In specific, I am interested in this because PyScript is discussing adding a builtin called display which is like a web aware print and they want to make it a builtin.
https://github.com/pyscript/pyscript/discussions/1687
It's worth pointing out that typescript also has a version of this feature with declare global. Though the JavaScript ecosystem also has a lot of tools that pollute the "builtins"-level scope so they have a much stronger need for this sort of thing.
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
Lee la documentación referenciada de pyright en docs/builtins.md y compara el comportamiento de builtins.pyi con el manejo existente de builtins.pyi en mypy. Sigue cómo se descubre la raíz del proyecto y cómo se cargan las definiciones de builtins; el trabajo estará terminado cuando un stub personalizado en la raíz contribuya símbolos a la comprobación de tipos y haya pruebas que cubran este comportamiento.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- devtools
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 30/100