__doc__ = u"""
>>> x = X()
>>> x.slots
- ['']
+ [b'']
"""
+import sys
+if sys.version_info[0] < 3:
+ __doc__ = __doc__.replace(u" b'", u" '")
+
class X:
slots = ["", ]
>>> g()
(1, 1, 2, 2, 3, 3)
>>> h()
- (1, 'test', 3, 1, 'test', 3)
+ (1, b'test', 3, 1, b'test', 3)
>>> j()
(2, 1, 4, 2, 6, 3)
"""
+import sys
+if sys.version_info[0] < 3:
+ __doc__ = __doc__.replace(u" b'", u" '")
+
def f():
cdef object obj1a, obj2a, obj3a, obj1b, obj2b, obj3b
obj1b, obj2b, obj3b = 1, 2, 3
True
"""
+import sys
+if sys.version_info[0] >= 3:
+ __doc__ = __doc__.replace(u"2L", u"2")
+
def f(obj2, obj3):
cdef float flt1, flt2, flt3
flt2, flt3 = obj2, obj3
__doc__ = u"""
>>> def test(a, b):
- ... print a, b, add(a, b)
+ ... print((a, b, add(a, b)))
>>> test(1, 2)
- 1 2 3
+ (1, 2, 3)
>>> test(17.3, 88.6)
- 17.3 88.6 105.9
- >>> test("eggs", "spam")
- eggs spam eggsspam
+ (17.3, 88.6, 105.9)
+ >>> test(u"eggs", u"spam")
+ (u'eggs', u'spam', u'eggsspam')
"""
+import sys
+if sys.version_info[0] >= 3:
+ __doc__ = __doc__.replace(u" u'", u" '")
+
def add(x, y):
return x + y
import sys
if sys.version_info[0] >= 3:
- __doc__ = __doc__.replace(u"Exception, e'", u"Exception as e")
+ __doc__ = __doc__.replace(u"Exception, e", u"Exception as e")
cdef class A:
def __cinit__(self):
__doc__ = u"""
>>> f(100)
-101
+101L
>>> g(3000000000)
-3000000001
+3000000001L
"""
+import sys
+if sys.version_info[0] >= 3:
+ __doc__ = __doc__.replace(u"L", u"")
+
def f(x):
cdef unsigned long long ull
ull = x
import sys
if sys.version_info[0] >= 3:
- __doc__ = __doc__.replace(u"Exception, e'", u"Exception as e")
+ __doc__ = __doc__.replace(u"Exception, e", u"Exception as e")
def bar():
try: