From: Robert Bradshaw Date: Wed, 29 Oct 2008 00:08:28 +0000 (-0700) Subject: more tests for callargs X-Git-Tag: 0.9.9.2.beta~2^2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0cd778f265f297f6a29e4c8661a28ca1c214cfdb;p=cython.git more tests for callargs --- 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