Calling a generator multiple times

Just van Rossum just at letterror.com
Sat Dec 8 06:50:42 EST 2001


Oren Tirosh wrote:
> 
> On Sat, Dec 08, 2001 at 12:30:25AM +0000, Courageous wrote:
> >
> > >A generator is a function or method that -- by virtue of using the yield
> > >statement --
> >
> > I understand how it works, intuitively. My objection is not that
> > I don't understand it, but rather that a lone keyword appearing
> > in the content of the method definition actually changes what is
> > being defined. That's just plain wrong.
> 
> I agree.  It should be immediately apparent that a generator function is
> not a regular instance of the 'function' type.  [ ... ]

  "That's just plain wrong"
  "It should be immediately apparent that..."

If it _was_ "plain wrong" it wouldn't be the way it is. I mentioned the
archives of python-iterators list before, but I think the PEP is a better
reference:
       http://python.sourceforge.net/peps/pep-0255.html

Just



More information about the Python-list mailing list