from __future__ import generators not working in IDLE
Guido van Rossum
guido at python.org
Tue Jul 31 13:36:02 EDT 2001
"Grace" <nospam at nospam.com> writes:
> "from __future__ import generators" does not work in IDLE which is included
> in Python 2.2a1.
>
> See the copy&pasted text from the real IDLE running:
>
> >>> from __future__ import generators
> >>>
> >>> <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
> def f():
> yield 1
>
> SyntaxError: invalid syntax
> >>>
>
> Is there any workarounds?
Not yet (apart from adding "from __future__ import generators" to the
top of codeop.py). But in python-dev Michael Hudson is working on a
fix to codeop that will let us select compilation flags.
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-list
mailing list