Comment Comment by Ded7xSEoPKYNsDd The standard python linters can do it: $ flake8 foo.py foo.py:6:14: F821 undefined name 'q' $ mypy --check-untyped-defs foo.py foo.py:6: error: Name 'q' is not defined (They also have some other complaints about your code that you'd either have to disable or adjust to.) parent Ded7xSEoPKYNsDd 6 years ago