[Python-Dev] Generator details

Tim Peters tim_one@email.msn.com
Tue, 13 Jul 1999 00:03:30 -0400


[Guido]
> ...
> Hmm...  I think that if the generator is started by a for loop, it's
> okay for the loop to assume it is the master of the universe -- just
> like there's no force in the world (apart from illegal C code :) that
> can change the hidden loop counter in present-day for loop.

If it comes to a crunch, me too.  I think your idea of forcing an exception
in the frame's destructor (to get the stacks cleaned up, and any suspended
"finally" blocks executed) renders this a non-issue, though (it will "just
work", and if people resort to illegal C code, it will *still* work <wink>).

hadn't-noticed-you-can't-spell-"illegal-code"-without-"c"-ly y'rs  - tim