Closed cclauss closed 6 months ago
% pipx run ruff --select=E9,F63,F7,F82 .
pipx run ruff --select=E9,F63,F7,F82 .
api.py:91:54: F821 Undefined name `payload`
% pipx run ruff rule F821
pipx run ruff rule F821
Derived from the Pyflakes linter.
Checks for uses of undefined names.
An undefined name is likely to raise NameError at runtime.
NameError
def double(): return n * 2 # raises `NameError` if `n` is undefined when `double` is called
Use instead:
def double(n): return n * 2
%
pipx run ruff --select=E9,F63,F7,F82 .
%
pipx run ruff rule F821
undefined-name (F821)
Derived from the Pyflakes linter.
What it does
Checks for uses of undefined names.
Why is this bad?
An undefined name is likely to raise
NameError
at runtime.Example
Use instead:
References