[Python-ideas] Yield-from example: A parser

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Feb 17 21:48:37 CET 2009


Antoine Pitrou wrote:

> They may be syntactically different, but semantically they look completely the
> same.

The control structure is inverted. Sometimes it's more
convenient to push instead of pull.

If everything could always be done using pulls, there
would be no need for send() in the first place.

> (*) by the way, using a "for" loop would probably have felt more natural

Not sure what you mean by that. There's no single place
in the parser that loops until the input is exhausted.

-- 
Greg




More information about the Python-ideas mailing list