Message84274
> 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). |
|
Date |
User |
Action |
Args |
2009-03-27 16:41:38 | pitrou | set | recipients:
+ pitrou, qwjqwj |
2009-03-27 16:41:37 | pitrou | link | issue5577 messages |
2009-03-27 16:41:37 | pitrou | create | |
|