internetarchive / wikibase-patcher

Python library for interacting with the Wikibase REST API
GNU General Public License v3.0
9 stars 1 forks source link

api.py: Fix undefined name payload #2

Closed cclauss closed 6 months ago

cclauss commented 1 year ago

% pipx run ruff --select=E9,F63,F7,F82 .

api.py:91:54: F821 Undefined name `payload`

% 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

def double():
    return n * 2  # raises `NameError` if `n` is undefined when `double` is called

Use instead:

def double(n):
    return n * 2

References