Re: generator functions: why won't this work?

2008-04-04 Thread Arnaud Delobelle
On Apr 2, 11:04 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 02 Apr 2008 14:11:30 -0300, <[EMAIL PROTECTED]> escribió: > > > On Apr 1, 10:42 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > >> En Tue, 01 Apr 2008 23:56:50 -0300, <[EMAIL PROTECTED]> escribió: > > >>    yield

Re: generator functions: why won't this work?

2008-04-04 Thread Robert Lehmann
On Wed, 02 Apr 2008 19:04:30 -0300, Gabriel Genellina wrote: > En Wed, 02 Apr 2008 14:11:30 -0300, <[EMAIL PROTECTED]> escribió: > >> On Apr 1, 10:42 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >>> En Tue, 01 Apr 2008 23:56:50 -0300, <[EMAIL PROTECTED]> >>> escribió: >>> >>>    yield *iter

Re: generator functions: why won't this work?

2008-04-02 Thread Mel
[EMAIL PROTECTED] wrote: > On Apr 2, 3:57 pm, Mel <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> >> I'd just like to test my >> >>> understanding of this. Suppose I create the following generator >>> object: >>> g = getNextScalar(1, 2, (3, 4), 5) >>> when the iterator reaches the tuple a

Re: generator functions: why won't this work?

2008-04-02 Thread Gabriel Genellina
En Wed, 02 Apr 2008 14:11:30 -0300, <[EMAIL PROTECTED]> escribió: > On Apr 1, 10:42 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Tue, 01 Apr 2008 23:56:50 -0300, <[EMAIL PROTECTED]> escribió: >> >>    yield *iterable >> >> could be used as a shortcut for this: >> >>    for __temp in

Re: generator functions: why won't this work?

2008-04-02 Thread zillow10
On Apr 2, 3:57 pm, Mel <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I'd just like to test my > > > understanding of this. Suppose I create the following generator > > object: > > > g = getNextScalar(1, 2, (3, 4), 5) > > > when the iterator reaches the tuple argument (3, 4) then, accord

Re: generator functions: why won't this work?

2008-04-02 Thread castironpi
On Apr 1, 10:42 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 01 Apr 2008 23:56:50 -0300, <[EMAIL PROTECTED]> escribió: > >    yield *iterable > > could be used as a shortcut for this: > >    for __temp in iterable: yield __temp How serious were you about that? -- http://mail.pytho

Re: generator functions: why won't this work?

2008-04-02 Thread Mel
[EMAIL PROTECTED] wrote: I'd just like to test my > understanding of this. Suppose I create the following generator > object: > > g = getNextScalar(1, 2, (3, 4), 5) > > when the iterator reaches the tuple argument (3, 4) then, according to > Steve and George, the * in *arg causes this tuple to be

Re: generator functions: why won't this work?

2008-04-02 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Apr 2, 4:42 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> En Tue, 01 Apr 2008 23:56:50 -0300, <[EMAIL PROTECTED]> escribió: >> >>> I'm trying to understand generator functions and the yield keyword. >>> I'd like to understand why the following code isn't suppos

Re: generator functions: why won't this work?

2008-04-02 Thread zillow10
On Apr 2, 4:42 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 01 Apr 2008 23:56:50 -0300, <[EMAIL PROTECTED]> escribió: > > > I'm trying to understand generator functions and the yield keyword. > > I'd like to understand why the following code isn't supposed to work. > > (What I would

Re: generator functions: why won't this work?

2008-04-01 Thread Gabriel Genellina
En Tue, 01 Apr 2008 23:56:50 -0300, <[EMAIL PROTECTED]> escribió: > I'm trying to understand generator functions and the yield keyword. > I'd like to understand why the following code isn't supposed to work. > (What I would have expected it to do is, for a variable number of > arguments composed o

Re: generator functions: why won't this work?

2008-04-01 Thread George Sakkis
On Apr 1, 11:17 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Apr 1, 10:56 pm, [EMAIL PROTECTED] wrote: > > > > > Hi all, > > > I'm trying to understand generator functions and the yield keyword. > > I'd like to understand why the following code isn't supposed to work. > > (What I would have ex

Re: generator functions: why won't this work?

2008-04-01 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hi all, > > I'm trying to understand generator functions and the yield keyword. > I'd like to understand why the following code isn't supposed to work. > (What I would have expected it to do is, for a variable number of > arguments composed of numbers, tuples of numbers,

Re: generator functions: why won't this work?

2008-04-01 Thread George Sakkis
On Apr 1, 10:56 pm, [EMAIL PROTECTED] wrote: > Hi all, > > I'm trying to understand generator functions and the yield keyword. > I'd like to understand why the following code isn't supposed to work. > (What I would have expected it to do is, for a variable number of > arguments composed of numbers,

Re: generator functions: why won't this work?

2008-04-01 Thread Mel
[EMAIL PROTECTED] wrote: > I'm trying to understand generator functions and the yield keyword. > I'd like to understand why the following code isn't supposed to work. > (What I would have expected it to do is, for a variable number of > arguments composed of numbers, tuples of numbers, tuples of tu

generator functions: why won't this work?

2008-04-01 Thread zillow20
Hi all, I'm trying to understand generator functions and the yield keyword. I'd like to understand why the following code isn't supposed to work. (What I would have expected it to do is, for a variable number of arguments composed of numbers, tuples of numbers, tuples of tuples, etc., the function