>>> g(1,2, c=1, e=0, f=2, d=11)
>>> g(1,2, c=1, f=2, e=0, x=25)
- >>> g(1,2,3)
+ >>> g(1,2,3) #doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: function takes at most 3 positional arguments (4 given)
>>> g(1,2)
TypeError: required keyword argument 'f' is missing
"""
+import sys, re
+if sys.version_info[0] >= 3:
+ __doc__ = re.sub(u"Error: (.*)exactly(.*)", u"Error: \\1at most\\2", __doc__)
+
+import sys, re
+if sys.version_info[0] >= 3:
+ __doc__ = re.sub(u"(ELLIPSIS[^>]*Error: )[^\n]*\n", u"\\1...\n", __doc__, re.M)
+
class Spam:
def b(self, a, b, c):
pass
TypeError: required keyword argument 'f' is missing
"""
+import sys, re
+if sys.version_info[0] >= 3:
+ __doc__ = re.sub(u"Error: (.*)exactly(.*)", u"Error: \\1at most\\2", __doc__)
+
cdef class Ext:
def b(self, a, b, c):
pass
>>> spam(1,2) #doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: function takes exactly 3 arguments (2 given)
- >>> spam(1,2,3,4) #doctest: +ELLIPSIS
+ >>> spam(1,2,3,4)
Traceback (most recent call last):
TypeError: function takes exactly 3 arguments (4 given)
>>> spam(1,2,3, a=1) #doctest: +ELLIPSIS
>>> swallow(1,2,3)
(1, 2, 3, ())
- >>> swallow(1,2,3,4) #doctest: +ELLIPSIS
+ >>> swallow(1,2,3,4)
Traceback (most recent call last):
TypeError: function takes at most 3 positional arguments (4 given)
>>> swallow(1,2,3, a=1, b=2)
(1,)
>>> onlyt(1,2)
(1, 2)
- >>> onlyt(a=1) #doctest: +ELLIPSIS
+ >>> onlyt(a=1)
Traceback (most recent call last):
TypeError: 'a' is an invalid keyword argument for this function
- >>> onlyt(1, a=2) #doctest: +ELLIPSIS
+ >>> onlyt(1, a=2)
Traceback (most recent call last):
TypeError: 'a' is an invalid keyword argument for this function
(('a', 1),)
>>> onlyk(a=1, b=2)
(('a', 1), ('b', 2))
- >>> onlyk(1) #doctest: +ELLIPSIS
+ >>> onlyk(1)
Traceback (most recent call last):
TypeError: function takes at most 0 positional arguments (1 given)
- >>> onlyk(1, 2) #doctest: +ELLIPSIS
+ >>> onlyk(1, 2)
Traceback (most recent call last):
TypeError: function takes at most 0 positional arguments (2 given)
- >>> onlyk(1, a=1, b=2) #doctest: +ELLIPSIS
+ >>> onlyk(1, a=1, b=2)
Traceback (most recent call last):
TypeError: function takes at most 0 positional arguments (1 given)
import sys, re
if sys.version_info[0] >= 3:
- __doc__ = re.sub(u"Error: (.*)", u"Error: ...", __doc__)
+ __doc__ = re.sub(u"Error: (.*)exactly(.*)", u"Error: \\1at most\\2", __doc__)
+
+import sys, re
+if sys.version_info[0] >= 3:
+ __doc__ = re.sub(u"(ELLIPSIS[^>]*Error: )[^\n]*\n", u"\\1...\n", __doc__, re.M)
cdef sorteditems(d):
l = list(d.items())
TypeError: required keyword argument 'f' is missing
"""
+import sys, re
+if sys.version_info[0] >= 3:
+ __doc__ = re.sub(u"Error: (.*)exactly(.*)", u"Error: \\1at most\\2", __doc__)
+
def b(a, b, c):
pass
__doc__ = u"""
>>> def test(a, b):
- ... print((a, b, add(a, b)))
+ ... return (a, b, add(a, b))
>>> test(1, 2)
(1, 2, 3)
- >>> [ repr(f) for f in test(17.3, 88.6) ]
- [17.3, 88.6, 105.9]
+ >>> [ str(f) for f in test(17.3, 88.6) ]
+ ['17.3', '88.6', '105.9']
>>> test(u"eggs", u"spam")
(u'eggs', u'spam', u'eggsspam')
"""
TypeError: function takes exactly 3 arguments (0 given)
"""
+import sys, re
+if sys.version_info[0] >= 3:
+ __doc__ = re.sub(u"Error: (.*)exactly(.*)", u"Error: \\1at most\\2", __doc__)
+
cdef class Spam:
def __init__(self, a, b, int c):
Traceback (most recent call last):
TypeError: an integer is required
- >>> fail0(1,2)
+ >>> fail0(1,2) #doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: function takes exactly 2 arguments (0 given)
- >>> fail1(1,2)
+ >>> fail1(1,2) #doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: function takes exactly 2 arguments (1 given)
"""
+import sys, re
+if sys.version_info[0] >= 3:
+ __doc__ = re.sub(u"Error: .*exactly.*", u"Error: ...", __doc__)
+
import sys
if sys.version_info[0] < 3:
__doc__ = __doc__.replace(u" b'", u" '")
>>> spam(1,2) #doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: function takes exactly 3 arguments (2 given)
- >>> spam(1,2,3,4) #doctest: +ELLIPSIS
+ >>> spam(1,2,3,4)
Traceback (most recent call last):
TypeError: function takes exactly 3 arguments (4 given)
>>> spam(1,2,3, a=1) #doctest: +ELLIPSIS
>>> swallow(1,2,3)
(1, 2, 3, ())
- >>> swallow(1,2,3,4) #doctest: +ELLIPSIS
+ >>> swallow(1,2,3,4)
Traceback (most recent call last):
TypeError: function takes at most 3 positional arguments (4 given)
>>> swallow(1,2,3, a=1, b=2)
(1,)
>>> onlyt(1,2)
(1, 2)
- >>> onlyt(a=1) #doctest: +ELLIPSIS
+ >>> onlyt(a=1)
Traceback (most recent call last):
TypeError: 'a' is an invalid keyword argument for this function
- >>> onlyt(1, a=2) #doctest: +ELLIPSIS
+ >>> onlyt(1, a=2)
Traceback (most recent call last):
TypeError: 'a' is an invalid keyword argument for this function
(('a', 1),)
>>> onlyk(a=1, b=2)
(('a', 1), ('b', 2))
- >>> onlyk(1) #doctest: +ELLIPSIS
+ >>> onlyk(1)
Traceback (most recent call last):
TypeError: function takes at most 0 positional arguments (1 given)
- >>> onlyk(1, 2) #doctest: +ELLIPSIS
+ >>> onlyk(1, 2)
Traceback (most recent call last):
TypeError: function takes at most 0 positional arguments (2 given)
- >>> onlyk(1, a=1, b=2) #doctest: +ELLIPSIS
+ >>> onlyk(1, a=1, b=2)
Traceback (most recent call last):
TypeError: function takes at most 0 positional arguments (1 given)
import sys, re
if sys.version_info[0] >= 3:
- __doc__ = re.sub(u"Error: (.*)", u"Error: ...", __doc__)
+ __doc__ = re.sub(u"Error: (.*)exactly(.*)", u"Error: \\1at most\\2", __doc__)
+
+import sys, re
+if sys.version_info[0] >= 3:
+ __doc__ = re.sub(u"(ELLIPSIS[^>]*Error: )[^\n]*\n", u"\\1...\n", __doc__, re.M)
cdef sorteditems(d):
l = list(d.items())