[Python-Dev] Generator details

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


[Barry]
> Minor point, but why not make resume() and shutdown() methods on the
> frame?  Isn't this much cleaner?
>
>     value, frame = generator(args)
>     try:
> 	while frame:
> 	    etc
> 	    value, frame = frame.resume()
>     finally:
> 	if frame:
> 	    frame.shutdown()

Yes -- and at least it's better than arguing over what to name them <wink>.

btw-tabs-in-email-don't-look-the-way-you-expect-them-to-ly y'rs  - tim