This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients pitrou, qwjqwj
Date 2009-03-27.16:41:37
SpamBayes Score 0.0025069804
Marked as misclassified No
Message-id <1238172178.6929.28.camel@fsol>
In-reply-to <1238171608.03.0.996800305712.issue5577@psf.upfronthosting.co.za>
Content
> More experiments:
> The tuple pair (10,20) don't correspond to (i,i*i)

This is normal, since it corresponds to ((yield i), (yield i*i)).
The value of a yield expression is what the caller puts into send(), not
what is yielded to the caller. And since you sent 10 then 20, the
resulting tuple is (10, 20).

> The yield order is distorted

It is quite logical actually. The generator first has to yield two
values before being able to produce a third one (the tuple consisting of
the value of two "yield" expressions).
History
Date User Action Args
2009-03-27 16:41:38pitrousetrecipients: + pitrou, qwjqwj
2009-03-27 16:41:37pitroulinkissue5577 messages
2009-03-27 16:41:37pitroucreate