tuplereassign.pyx 392 Bytes
Newer Older
1
__doc__ = u"""
Stefan Behnel's avatar
Stefan Behnel committed
2 3 4 5 6 7
    >>> test1( (1,2,3) )
    1
    >>> test3( (1,2,3) )
    3
    >>> test( (1,2,3) )
    3
8
    >>> testnonsense()     # doctest: +ELLIPSIS
Stefan Behnel's avatar
Stefan Behnel committed
9
    Traceback (most recent call last):
10
    TypeError: ...
Stefan Behnel's avatar
Stefan Behnel committed
11 12 13 14 15 16 17 18 19 20 21 22 23
"""

def test1(t):
    t,a,b = t
    return t

def test3(t):
    a,b,t = t
    return t

def test(t):
    t,t,t = t
    return t
Stefan Behnel's avatar
Stefan Behnel committed
24 25 26 27

def testnonsense():
    t,t,t = 1*2
    return t