(why) inconsistent yield/return syntax?

Gerrit Holl gerrit at nl.linux.org
Mon Feb 10 21:50:15 CET 2003


Mark McEahern schreef op maandag 10 februari om 21:43:10 +0000:
> [Gerrit Holl]
> > > Read up on generators.  Google is your friend.
> >
> > I have.
> > If if wouldn't have done that, it would be:
> >
> >   1 >>> def f(): yield
> >   <stdin>:1: Warning: 'yield' will become a reserved keyword in the future
> >
> > But it was:
> >  46 >>> def f(): yield
> >    File "<stdin>", line 1
> >        def f(): yield
> 
> That leaves me wondering what your question is then.

An empty return is ok and return None, but an empty yield isn't.
My question is why...

yours,
Gerrit.

-- 
Asperger Syndroom - een persoonlijke benadering:
	http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
	http://www.sp.nl/





More information about the Python-list mailing list