from __future__ import generators

Paul Moore gustav at morpheus.demon.co.uk
Mon Aug 13 17:42:19 EDT 2001


On Sun, 12 Aug 2001 01:48:50 GMT, Guido van Rossum <guido at python.org> wrote:

>Use of 'yield' as an identifier is not a silent breakage -- there has
>to be at least one defining occurrence of yield when used as a
>variable, function, module or class name, and that will always be a
>syntax error.  This is why I proposed that, *if* there is enough
>popular support, the future generators statement might be
>unnecessary.  But it doesn't look likely.

Let me add my support for the idea of not needing a future statement. I tend to
view features which require a future statement as "not really available yet". So
the future statement makes generators "feel like" they are unavailable until
2.3. But I feel this is a shame, as generators are very powerful, and very
useful - and I'd rather see them available (and hence mainstream) as soon as
possible.

Backward compatibility is certainly important, more so to some users than
others, but this is not a particularly disastrous change - in the worst case, a
simple search-and-replace operation would probably fix 99.9% of all code where
there is an issue. And as you say, the breakage is not silent (excluding silly
contrived examples).

Paul.



More information about the Python-list mailing list