From: Stefan Behnel Date: Tue, 14 Dec 2010 06:15:07 +0000 (+0100) Subject: extended test case X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=21d0f992fcdcd0c5f747595b3f09df5a46001576;p=cython.git extended test case --- diff --git a/tests/run/generators.pyx b/tests/run/generators.pyx index de15c1ad..f2243afc 100644 --- a/tests/run/generators.pyx +++ b/tests/run/generators.pyx @@ -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): """