--disallow-untyped-calls allows calling values with Any type
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
The calls to f and ff below aren't rejected when using --disallow-untyped-calls, even though I believe that they should be:
from typing import Any
from non_existent import f # type: ignore # Not in the build
def g(): pass
def h() -> None:
g(asdf=1) # Error: Call to untyped function "g" in typed context
f(asdf=1) # No error reported, but this is untyped
ff: Any
ff() # No error reported, and again this in untyped
At the very least the first call should probably be caught. If non_existent gets added in the build with no type annotations, it would start generating errors. However, I'd expect that adding a module to the build should result in fewer Any-related errors, not more.
Marking this a high priority since I've been bit by this twice in production code.
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
Reproduce el ejemplo de Python del issue con --disallow-untyped-calls y, a continuación, rastrea cómo se comprueban las llamadas a través de valores importados y valores tipados explícitamente como Any. Se considera completado cuando se rechazan las llamadas a f y ff sin cambiar el diagnóstico existente para g; el payload no indica ningún archivo fuente ni ninguna prueba desde la que empezar.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- compilers, devtools
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 39/100