(🎁) Option to not report errors from stub bodies
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 20.6k
- Forks
- 3.3k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
test.py:
import foo
foo.foo("")
stubs/foo/init.pyi:
def foo(i: int) -> None:
1 + ""
mypy test.py
stubs/foo/__init__.pyi:2: error: Unsupported operand types for + ("int" and "str")
test.py:2: error: Argument 1 to "foo" has incompatible type "str"; expected "int"
Found 2 errors in 2 files (checked 1 source file)
In when I'm working with mypy I basically copy-paste the src of libraries into a stubs folder and gradually type them as needed, but it's a pain when I get errors on the bodies of functions like
stubs/x/y/z.pyi error: Call to untyped function "amongus" in typed context [no-untyped-call]
The bodies of stub functions shouldn't need to be typechecked imo and there should be an option to disable this.
I don't delete the bodies of the functions because that would be a lot of work, and it is kinda convinient that the impl and types are in the same place.
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
Use the test.py and stubs/foo/init.pyi reproducer and run mypy test.py. Trace how diagnostics from stub function bodies are produced, then verify an option suppresses those diagnostics while retaining the call-site argument error.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- compilers, tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100