From f3ef06a7cb347ab7bd3cc2b0b3dcebe4f9ff36f9 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Tue, 15 Oct 2019 12:40:02 +0100 Subject: bpo-38478: Correctly handle keyword argument with same name as positional-only parameter (GH-16800) --- Lib/inspect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/inspect.py') diff --git a/Lib/inspect.py b/Lib/inspect.py index c2a1ed4148..3ff395ca33 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -2960,7 +2960,7 @@ class Signature: arguments[param.name] = tuple(values) break - if param.name in kwargs: + if param.name in kwargs and param.kind != _POSITIONAL_ONLY: raise TypeError( 'multiple values for argument {arg!r}'.format( arg=param.name)) from None -- cgit v1.2.1