Greg Ewing wrote:
Nick Coghlan wrote:
Sometimes I miss the obvious. There's a *much*, *much* better place to store
the return value of a generator than on the StopIteration exception that it
raises when it finishes. Just save the return value in the *generator*.
I'm not convinced that
On 10/10/05, Nick Coghlan [EMAIL PROTECTED] wrote:
I'm starting to think we want to let PEP 342 bake for at least one release
cycle before deciding what (if any) additional behaviour should be added to
generators.
Yes please!
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
Nick Coghlan wrote:
Although, if StopIteration.result was a read-only property with the above
definition, wouldn't that give us the benefit of one obvious way to return
a
value from a coroutine without imposing any runtime cost on normal use of
StopIteration to finish an iterator?
On 10/9/05, Nick Coghlan [EMAIL PROTECTED] wrote:
Sometimes I miss the obvious. There's a *much*, *much* better place to store
the return value of a generator than on the StopIteration exception that it
raises when it finishes. Just save the return value in the *generator*.
And then provide a
Nick Coghlan wrote:
Sometimes I miss the obvious. There's a *much*, *much* better place to store
the return value of a generator than on the StopIteration exception that it
raises when it finishes. Just save the return value in the *generator*.
I'm not convinced that this is better, because