[Python] How to catch potentially undefined variables with pylint or mypy?

Discussão em 'Python' iniciado por Stack, Agosto 16, 2025.

  1. Stack

    Stack Membro Participativo

    import time

    if time.time() > 42:
    x = 1

    print(x)


    My IDE (PyCharm) warns me about x potentially being undefined:

    [​IMG]

    But pylint and mypy do not say anything. Is there a way to make one of them complain about this situation too?

    Continue reading...

Compartilhe esta Página