Antoine Pitrou <pit...@free.fr> added the comment: > 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). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5577> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com