Re: PEP 288 ponderings

2005-01-02 Thread Michael Sparks
On Sun, 2 Jan 2005, Ian Bicking wrote: > Steven Bethard wrote: > > PEP 288 was mentioned in one of the lambda threads and so I ended up > > reading it for the first time recently. I definitely don't like the > > idea of a magical __self__ variable that isn't declared anywhere. It > > also seemed

Re: PEP 288 ponderings

2005-01-02 Thread Steven Bethard
Raymond Hettinger wrote: [Steven Bethard] (2) Since in all the examples there's a one-to-one correlation between setting a generator attribute and calling the generator's next function, aren't these generator attribute assignments basically just trying to define the 'next' parameter list? They are

Re: PEP 288 ponderings

2005-01-02 Thread Raymond Hettinger
[Steven Bethard] > (1) What's the benefit of the generator versions of these functions over > the class-based versions? Generators are easier to write, are clearer, and run faster. They automatically * create a distinct generator-iterator object upon each invocation * create the next() and idempo

Re: PEP 288 ponderings

2005-01-01 Thread Nick Coghlan
Ian Bicking wrote: Using a one-element list is kind of annoying, because it isn't clear out of context that it's just a way of creating shared state. But it's okay, work right now, and provides the exact same functionality. Uh, isn't shared state what classes were invented for? Py> class mygen(o

Re: PEP 288 ponderings

2005-01-01 Thread Ian Bicking
Steven Bethard wrote: PEP 288 was mentioned in one of the lambda threads and so I ended up reading it for the first time recently. I definitely don't like the idea of a magical __self__ variable that isn't declared anywhere. It also seemed to me like generator attributes don't really solve the

Re: PEP 288 ponderings

2005-01-01 Thread Jp Calderone
On Sun, 02 Jan 2005 01:04:06 GMT, Steven Bethard <[EMAIL PROTECTED]> wrote: >PEP 288 was mentioned in one of the lambda threads and so I ended up > reading it for the first time recently. I definitely don't like the > idea of a magical __self__ variable that isn't declared anywhere. It > also

PEP 288 ponderings

2005-01-01 Thread Steven Bethard
PEP 288 was mentioned in one of the lambda threads and so I ended up reading it for the first time recently. I definitely don't like the idea of a magical __self__ variable that isn't declared anywhere. It also seemed to me like generator attributes don't really solve the problem very cleanly