Commit df0ff793 authored by Robert Bradshaw's avatar Robert Bradshaw

more call tests with keywords

parent 0cd778f2
...@@ -100,6 +100,17 @@ __doc__ = u""" ...@@ -100,6 +100,17 @@ __doc__ = u"""
1 2 0 0 1 2 0 0
>>> d(1,2,3) >>> d(1,2,3)
1 2 1 0 1 2 1 0
>>> d(key=None)
Traceback (most recent call last):
TypeError: d() takes at least 1 positional argument (0 given)
>>> d(1, key=None)
1 1 0 1
>>> d(1,2, key=None)
1 2 0 1
>>> d(1,2,3, key=None)
1 2 1 1
""" """
def d(a, b=1, *args, **kwds): def d(a, b=1, *args, **kwds):
...@@ -125,7 +136,6 @@ if sys.version_info[0] >= 3: ...@@ -125,7 +136,6 @@ if sys.version_info[0] >= 3:
else: else:
kwargs = {"test" : u"toast"} kwargs = {"test" : u"toast"}
def test_kw_args(f): def test_kw_args(f):
f(1,2, c=3) f(1,2, c=3)
f(1,2, d=3, *args) f(1,2, d=3, *args)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment