summaryrefslogtreecommitdiff
path: root/pylint
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-04-10 05:55:35 +0000
committerGitHub <noreply@github.com>2023-04-10 05:55:35 +0000
commit61dae1e5f4fa4b8f2f93d8846e66f4eee6cc877f (patch)
tree4c77633f4b5ae776b705dec583e640f49c6bd44f /pylint
parentbcceff6be5903d8f3c203c59906b7fd46d72b499 (diff)
downloadpylint-git-61dae1e5f4fa4b8f2f93d8846e66f4eee6cc877f.tar.gz
Fix false positive for ``positional-only-arguments-expected`` when a function contains both a positional-only parameter that has a default value, and ``**kwargs``. (#8556) (#8560)
(cherry picked from commit db17860fd61154c59f3acc13ff34b120cc5ba091) Co-authored-by: Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com>
Diffstat (limited to 'pylint')
-rw-r--r--pylint/checkers/method_args.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/pylint/checkers/method_args.py b/pylint/checkers/method_args.py
index e88248219..8862328e3 100644
--- a/pylint/checkers/method_args.py
+++ b/pylint/checkers/method_args.py
@@ -111,6 +111,8 @@ class MethodArgsChecker(BaseChecker):
and inferred_func.args.posonlyargs
):
return
+ if inferred_func.args.kwarg:
+ return
pos_args = [a.name for a in inferred_func.args.posonlyargs]
kws = [k.arg for k in node.keywords if k.arg in pos_args]
if not kws: