Steven Bethard schrieb:
> Paul Rubin wrote:
>> The boilerplate
>>
>> def some_gen():
>>...
>>for x in some_other_gen():
>>yield x
>>...
>>
>> is so common (including the case where some_other_gen is the same as
>> some_gen, i.e. it's a recursive call) t
Kay Schluehr wrote:
> Maybe you should start by developing a design pattern first and
> publish it in the Cookbook. I have the fuzzy impression that the idea
> you are after, requires more powerfull control structures such as
> delimited continuations that are beyond ths scope of Pythons simple
>
On Apr 15, 10:23 am, Anton Vredegoor <[EMAIL PROTECTED]>
wrote:
> I'm currently also fascinated by the new generator possibilities, for
> example sending back a value to the generator by making yield return a
> value. What I would like to use it for is when I have a very long
> generator and I nee
Paul Rubin wrote:
> The boilerplate
>
> def some_gen():
>...
>for x in some_other_gen():
>yield x
>...
>
> is so common (including the case where some_other_gen is the same as
> some_gen, i.e. it's a recursive call) that I find myself wanting
> a more d
Paul Rubin wrote:
> def some_gen():
>...
>yield *some_other_gen()
>
> comes to mind. Less clutter, and avoids yet another temp variable
> polluting the namespace.
>
> Thoughts?
Well, not directly related to your question, but maybe these are some
ideas that would help dete
John Nagle <[EMAIL PROTECTED]> writes:
> > Less clutter, and avoids yet another temp variable polluting the namespace.
> Are we in danger of running out of temp variables?
There is unfortunately no way to contain the scope of a loop index to the
inside of the loop. Therefore introducing more
On 14 Apr 2007 22:17:08 -0700, Paul Rubin wrote
> The boilerplate
>
> def some_gen():
>...
>for x in some_other_gen():
>yield x
>...
>
> is so common (including the case where some_other_gen is the same as
> some_gen, i.e. it's a recursive call) that I find
Paul Rubin wrote:
> Less clutter, and avoids yet another temp variable
> polluting the namespace.
Are we in danger of running out of temp variables?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
The boilerplate
def some_gen():
...
for x in some_other_gen():
yield x
...
is so common (including the case where some_other_gen is the same as
some_gen, i.e. it's a recursive call) that I find myself wanting
a more direct way to express it:
def some_g