from __future__ import generators

Christian Tanzer tanzer at
Sun Aug 12 14:36:20 CEST 2001

pinard at (François Pinard) wrote:

> [Guido van Rossum]
> > If enough people prefer to always have the 'yield' keyword enabled, we can
> > do that.  I thought that there would be a huge opposition against breaking
> > code this way, but maybe it's OK.  At least 'yield' is not a silent break.
> My voice is surely not representative, but it is a voice nevertheless.
> When the direction is good, I prefer to see things moving forward, and
> would avoid `from __future__' here.  Yet, I also understand the concerns you
> have about not disturbing other Python users.  My opinion is that globally
> replacing `yield' by something else, using about any editor, is an easy
> challenge.  It could be advised somewhere in the transition documentation.

I checked my code and won't be effected by the introduction of
`yield` (unless some `yields` hide in dynamic code not showing up
in a grep :).

I'm also in favor of Python moving forward. But, and this is a big
but, I'm even more in favor of avoiding code breakage. Silent code
breakage is absolutely horrible, non-silent one is still a pain.

While it is easy to grep for occurences of `yield` it is not trivial
to automatically replace all the right occurences of it (and to avoid
replacing any of the wrong occurences during that process). If anybody
thinks otherwise, please post your preferred regular expression for
the replacement on I'd bet that it is either incorrect (i.e.,
not covering the right cases) or terribly unreadable.

Even though I'll be annoyed by the `__future__` imports I'd still vote
for them.


Christian Tanzer                                         tanzer at
Glasauergasse 32                                       Tel: +43 1 876 62 36
A-1130 Vienna, Austria                                 Fax: +43 1 877 66 92

More information about the Python-list mailing list