From 13e8dd858a9f40fd831444048315ee6cbf1e5a31 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 25 Dec 2008 01:07:32 +0100 Subject: [PATCH] extended test case --- tests/run/kwonlyargs.pyx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/run/kwonlyargs.pyx b/tests/run/kwonlyargs.pyx index 2994a559..aef2f1ef 100644 --- a/tests/run/kwonlyargs.pyx +++ b/tests/run/kwonlyargs.pyx @@ -89,6 +89,17 @@ __doc__ = u""" >>> l(1,2, d=1) Traceback (most recent call last): TypeError: l() takes exactly 0 positional arguments (2 given) + + >>> m(1, b=2) + >>> m(a=1, b=2) + >>> m(a=1, b=2, c=1) + + >>> l(1,2,3) + Traceback (most recent call last): + TypeError: l() takes exactly 0 positional arguments (3 given) + >>> l(1,2, d=1) + Traceback (most recent call last): + TypeError: l() takes exactly 0 positional arguments (2 given) """ def b(a, b, c): @@ -117,3 +128,6 @@ def k(a, b, c=1, *args, d = 42, e = 17, f, **kwds): def l(*, a, b, c = 88): pass + +def m(a, *, b, c = 88): + pass -- 2.26.2