multass.pyx 1.1 KB
Newer Older
1
__doc__ = """
Stefan Behnel's avatar
Stefan Behnel committed
2
    >>> h()
3
    (1, b'test', 3, 1, b'test', 3)
Stefan Behnel's avatar
Stefan Behnel committed
4 5
"""

6 7 8 9
import sys
if sys.version_info[0] < 3:
    __doc__ = __doc__.replace(u" b'", u" '")

Stefan Behnel's avatar
Stefan Behnel committed
10
def f():
11 12 13 14
    """
    >>> f()
    (1, 2, 1, 2)
    """
15
    cdef object obj1a, obj2a, obj3a, obj1b, obj2b, obj3b
Stefan Behnel's avatar
Stefan Behnel committed
16
    obj1b, obj2b, obj3b = 1, 2, 3
17
    obj1a, obj2a = obj1b, obj2b
Stefan Behnel's avatar
Stefan Behnel committed
18 19 20
    return obj1a, obj2a, obj1b, obj2b

def g():
21 22 23 24
    """
    >>> g()
    (1, 1, 2, 2, 3, 3)
    """
Stefan Behnel's avatar
Stefan Behnel committed
25 26
    cdef object obj1a, obj2a, obj3a, obj1b, obj2b, obj3b
    obj1b, obj2b, obj3b = 1, 2, 3
27
    obj1a, [obj2a, obj3a] = [obj1b, (obj2b, obj3b)]
Stefan Behnel's avatar
Stefan Behnel committed
28 29 30 31 32 33 34
    return obj1a, obj1b, obj2a, obj2b, obj3a, obj3b

def h():
    cdef object obj1a, obj2a, obj3a, obj1b, obj2b, obj3b
    cdef int int1, int2
    cdef char *ptr1, *ptr2
    int2, ptr2, obj1b = 1, "test", 3
35
    int1, ptr1, obj1a = int2, ptr2, obj1b
Stefan Behnel's avatar
Stefan Behnel committed
36 37 38
    return int1, ptr1, obj1a, int2, ptr2, obj1b

def j():
39 40 41 42
    """
    >>> j()
    (2, 1, 4, 2, 6, 3)
    """
Stefan Behnel's avatar
Stefan Behnel committed
43 44
    cdef object obj1a, obj2a, obj3a, obj1b, obj2b, obj3b
    obj1b, obj2b, obj3b = 1, 2, 3
45
    obj1a, obj2a, obj3a = obj1b + 1, obj2b + 2, obj3b + 3
Stefan Behnel's avatar
Stefan Behnel committed
46
    return obj1a, obj1b, obj2a, obj2b, obj3a, obj3b