pylint-dev/pylint

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

Open

#8785 aperta il 18 giu 2023

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)Python (1059 fork)batch import
False Negative 🦋Good first issueHacktoberfestNeeds PR

Metriche repository

Star
 (4978 star)
Metriche merge PR
 (Merge medio 58g 21h) (63 PR mergiate in 30 g)

Descrizione

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.

Guida contributor