from __future__ import generators

Tim Peters tim.one at home.com
Sat Aug 11 13:53:52 EDT 2001


[Joal Heagney]
> Well as a quick test, I went through my entire python1.5 install
> (because it's the oldest python code I've got lying around :) grepping
> for "yield" and only found the following references.
> ... [4 occurrences in comments] ...

The same is true of the current Python distribution.  But we don't ship any,
e.g., financial modeling code, so I bet "yield" isn't so conspicuous by
absence in *some* peoples' code.  We won't hear about it until it breaks,
though (by definition, alphas and betas don't find any problems in real
users' code <wink>).

[Andrew Dalke]
> ...
> The only other examples I saw in the first 200 hits were
> a use of yield for Stackless, and that Java's Thread uses a 'yield'
> method, which would be a concern for Jython.

Jython uses different parsing technology, and is tolerant of reusing
language keywords as method names.  From

    http://www.jython.org/docs/differences.html

    Jython allows keywords to be used as identifier name in some
    situations where there are no conflict.  This allows jython to
    call and override java methods with names like 'print' and
    'exec'.

CPython may grow that ability too someday, depending on when you submit a
patch to implement it <wink>.





More information about the Python-list mailing list