pyflakes
pyflakes copied to clipboard
A simple program which checks Python source files for errors
When importing or defining values in `if typing.TYPE_CHECKING` blocks the bound names will not be available at runtime and may cause errors when used in the following way: ```python import...
In this example pyflakes reports a misleading location for an unused variable: ``` $ cat example.py def foo(): exc = None try: print('foo') except NameError as exc: print(exc) $ pyflakes...
I just tracked down and annoying behavior change that we got in using Pyflakes when we upgraded from Python 2 to Python 3 in the Zulip project. It's related to...
*Original report by [tagrain](https://launchpad.net/~tagrain) on [Launchpad](https://bugs.launchpad.net/bugs/1675153):* ------------------------------------ *Please describe how you installed Flake8* Example: ``` python3 -m venv ~/.virtualenvs/flake8 workon flake8 pip install -U pip setuptools wheel pip install flake8...
I'm creating this mostly as a duplicate target pyflakes currently does not do any branch analysis and as such can't really know when things are conditionally defined / undefined /...
*Original report by [fawio](https://launchpad.net/~fawio) on [Launchpad](https://bugs.launchpad.net/bugs/1325966):* ------------------------------------ Hi, As far as I know, bug 872503 (#142) was meant to fix the issue of code using locals() not being recognized as...
I was pointed to [this buggy line](https://github.com/tensorflow/tensorflow/blob/d735866fae6a9f20eca5a74f513260c528f2258a/tensorflow/python/eager/function.py#L120): ``` if x is None != y is None: ``` (For context, Python allows chaining any of the comparison operators `==`, `!=`, `is`,...
``` def f(): x = None def g(): # Programmer forgot to add `nonlocal` here. if x is None: x = "hello" ``` `foo.py:5:12: F823 local variable 'x' (defined in...