Generators in 2.2a1

Chris Perkins chrisperkins99 at home.com
Mon Oct 1 03:17:48 CEST 2001


Perhaps I'm not reading the documentation right, but I get the impression 
that this should work:

Python 2.2a1 (#2, Sep 30 2001, 19:37:39) 
[GCC 2.96 20000731 (Linux-Mandrake 8.0 2.96-0.48mdk)] on linux2
Type "copyright", "credits" or "license" for more information.
IDLE 0.8 -- press F1 for help
>>> from __future__ import generators
>>> def gen():
        yield 1
        
<string>:2: Warning: 'yield' will become a reserved keyword in the future
<string>:2: Warning: 'yield' will become a reserved keyword in the future
<string>:2: Warning: 'yield' will become a reserved keyword in the future
SyntaxError: invalid syntax
>>> 

Am I missing something?

-- 
Chris Perkins



More information about the Python-list mailing list