pylint-dev/pylint

Use inference to determine if **kwargs is missing a named parameter

Open

#8.785 geöffnet am 18. Juni 2023

Auf GitHub ansehen
 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (1.059 Forks)batch import
False Negative 🦋Good first issueHacktoberfestNeeds PR

Repository-Metriken

Stars
 (4.978 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 58T 21h) (63 gemergte PRs in 30 T)

Beschreibung

I would expect these two lines to raise the same set of messages. We don't use inference to analyze whether **kwargs contains the missing named parameter x. We could.

import copy
import os

copy.copy(**{"y": os.environ})  # [unexpected-keyword-arg]
copy.copy(y=os.environ)  # [no-value-for-parameter, unexpected-keyword-arg]

False negative for no-value-for-parameter.

Contributor Guide