[Python] Why is mypy --check-untyped-defs not raising trivial error?

Discussão em 'Python' iniciado por Stack, Maio 30, 2025.

  1. Stack

    Stack Membro Participativo

    The help said:

    --check-untyped-defs Type check the interior of functions without type
    annotations (inverse: --no-check-untyped-defs)


    Why is mypy not able to find this trivial type error?

    def show(items):
    for item in items:
    print(item)

    a: int = 10
    show(a)

    Continue reading...

Compartilhe esta Página