Better error reporting for unavailable version or platform specific stub features
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start with build.py: State.init() and the find_module call that searches manager.lib_path, then inspect default.py: PYTHON3_version and default_lib_path. Determine how unavailable or older platform-specific stubs should be reported and whether Python 3.6 belongs in the search paths. Done means the behavior clearly alerts users when the selected stub is unavailable or older, with the version-search behavior matching the supported Python versions.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
When type-checking a python 3.6 file that contains from enum import auto, the latest build of mypy ( commit 0bb2d16 from master) complains: error: Module 'enum' has no attribute 'auto'. The reason is that build.py: State.__init__() finds the stub for enum using path = find_module(file_id, manager.lib_path); and the paths in manager.lib_path are something like
('.../typeshed/stdlib/3.4', .../typeshed/stdlib/3.3', '.../typeshed/stdlib/3', '.../third_party/3', '.../stdlib/2and3', '.../third_party/2and3')
It's understandable that stubs aren't yet available for the most recent library versions in typeshed, but I think mypy should perhaps warn the user about it to make it easier to figure out what the problem is. For instance, whenever a library stub used is for an older version, a warning could be logged?
Related to this is the fact that the default.py: PYTHON3_version is (3, 5); perhaps it should be updated to (3, 6)? As is, the default_lib_path doesn't even attempt to search in .../typeshed/stdlib/3.6 folder. (This wouldn't have helped in my case, since there's no enum.pyi in the 3.6 folder.)
Also related is #2897 that I just opened.
- Lenguaje dominante
- Python
- Estrellas
- 20.6k
- Forks
- 3.3k
- Merge medio
- 1 d 18 h
- PR fusionados (30 d)
- 54
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 python/mypy
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
bug topic-configuration topic-error-reporting
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Todos los issues de python/mypy
Issues similares
-
area/auth bug comp/agent P3 platform/discord type/security
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
NousResearch/hermes-agent#117848 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
bancolombia/sentinel#23 ·
-
test md AbiertoCI
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100