wow!

Roman Suzi rnd at onego.ru
Thu Jul 19 16:26:01 EDT 2001


>>> def a():
...   for i in range(5):
...    yield i
<stdin>:3: Warning: 'yield' will become a reserved keyword in the future
  File "<stdin>", line 3
    yield i
          ^
SyntaxError: invalid syntax
>>> # let's guess:
>>> from __future__ import generators
>>> def a():
...   for i in range(5):
...    yield i
...
>>> for k in a(): print k
...
0
1
2
3
4
>>>

Wow!

So I think letting know what I need from the __future__ could help:

<stdin>:3: Warning: 'yield' will become a reserved keyword in the future
  (try: from __future__ import generators to use it)

Sincerely yours, Roman Suzi
-- 
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Thursday, July 19, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "The bigger they are, the harder they hit you." _/





More information about the Python-list mailing list