From 0cd778f265f297f6a29e4c8661a28ca1c214cfdb Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Tue, 28 Oct 2008 17:08:28 -0700 Subject: [PATCH] more tests for callargs --- tests/run/callargs.pyx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/run/callargs.pyx b/tests/run/callargs.pyx index 27dff10a..1ca4bca4 100644 --- a/tests/run/callargs.pyx +++ b/tests/run/callargs.pyx @@ -90,8 +90,21 @@ __doc__ = u""" >>> test_int_kwargs(h) Traceback (most recent call last): TypeError: h() keywords must be strings + + >>> d() + Traceback (most recent call last): + TypeError: d() takes at least 1 positional argument (0 given) + >>> d(1) + 1 1 0 0 + >>> d(1,2) + 1 2 0 0 + >>> d(1,2,3) + 1 2 1 0 """ +def d(a, b=1, *args, **kwds): + print a, b, len(args), len(kwds) + def e(*args, **kwargs): print len(args), len(kwargs) @@ -103,7 +116,7 @@ def g(**kwargs): def h(a, b, c, *args, **kwargs): print a, b, c, u'*', len(args), len(kwargs) - + args = (9,8,7) import sys -- 2.26.2