Christian Tanzer wrote:
How about:
def main_generator():
...
yield * sub_generator()
Ducking-ly yrs,
I like that one, but I'd stick the star to the generator (e.g. yield
*sub_generator), the meaning being to unpack the generator into the
yield, same as unpacking a
The discussion about PEP 343 reminds me of the following. Bram Cohen
pointed out in private email that, before PEP 342, there wasn't a big
need for a shortcut to pass control to a sub-generator because the
following for-loop works well enough:
def main_generator():
...
for value in
Guido van Rossum [EMAIL PROTECTED] wrote:
The discussion about PEP 343 reminds me of the following. Bram Cohen
pointed out in private email that, before PEP 342, there wasn't a big
need for a shortcut to pass control to a sub-generator because the
following for-loop works well enough:
def
At 10:17 AM 01/20/2006 -0800, Guido van Rossum wrote:
The discussion about PEP 343 reminds me of the following. Bram Cohen
pointed out in private email that, before PEP 342, there wasn't a big
need for a shortcut to pass control to a sub-generator because the
following for-loop works well enough:
On 1/20/06, Phillip J. Eby [EMAIL PROTECTED] wrote:
At 10:17 AM 01/20/2006 -0800, Guido van Rossum wrote:
The discussion about PEP 343 reminds me of the following. Bram Cohen
pointed out in private email that, before PEP 342, there wasn't a big
need for a shortcut to pass control to a
Guido van Rossum [EMAIL PROTECTED] wrote:
The discussion about PEP 343 reminds me of the following. Bram Cohen
pointed out in private email that, before PEP 342, there wasn't a big
need for a shortcut to pass control to a sub-generator because the
following for-loop works well enough:
def
At 11:19 AM 01/20/2006 -0800, Guido van Rossum wrote:
(There *are*other uses besides the trampoline,
right? :-)
It's easy to come up with use cases where you feed data *into* a generator
(parsers and pipelines, for example). I just don't know of any
simultaneous bidirectional uses other than
Phillip J. Eby wrote:
Thoughts?
If we have to have a syntax, yield from sub_generator() seems clearer
than yieldthrough, and doesn't require a new keyword.
Andrew Koenig suggested the same phrasing last year [1], and I liked it then.
I don't like it any more, though, as I think it is too
Nick Coghlan wrote:
Exception propagation is a different story. What do you want to propagate?
All
exceptions from the body of the for loop? Or just those from the yield
statement?
Well, isn't factoring out exception processing part of what PEP 343 is for?
# We can even limit the
The discussion about PEP 343 reminds me of the following. Bram Cohen
pointed out in private email that, before PEP 342, there wasn't a big
need for a shortcut to pass control to a sub-generator because the
following for-loop works well enough:
def main_generator():
...
for
On Jan 20, 2006, at 1:39 PM, Phillip J. Eby wrote:
At 11:19 AM 01/20/2006 -0800, Guido van Rossum wrote:
(There *are*other uses besides the trampoline,
right? :-)
It's easy to come up with use cases where you feed data *into* a
generator
(parsers and pipelines, for example). I just
11 matches
Mail list logo