extended test case
authorStefan Behnel <scoder@users.berlios.de>
Tue, 14 Dec 2010 06:15:07 +0000 (07:15 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 14 Dec 2010 06:15:07 +0000 (07:15 +0100)
tests/run/generators.pyx

index de15c1adfbfd5a8ca94dca90bf3a2f44251d05fa..f2243afc994bf2cce9acacabcc047fe8dc809acd 100644 (file)
@@ -164,6 +164,19 @@ def test_first_assignment():
     yield y
     yield (x,y)
 
+def test_swap_assignment():
+    """
+    >>> gen = test_swap_assignment()
+    >>> next(gen)
+    (5, 10)
+    >>> next(gen)
+    (10, 5)
+    """
+    x,y = 5,10
+    yield (x,y)
+    x,y = y,x   # no ref-counting here
+    yield (x,y)
+
 
 class Foo(object):
     """