pylint-dev/pylint

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

Open

#8,785 建立於 2023年6月18日

在 GitHub 查看
 (4 留言) (0 反應) (0 負責人)Python (4,978 star) (1,059 fork)batch import
False Negative 🦋Good first issueHacktoberfestNeeds PR

描述

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.

貢獻者指南