Generators: section 9.10 of the python tutorial

David Stockwell winexpert at hotmail.com
Mon May 17 14:51:02 EDT 2004


Hi Matteo,

Thanks for the tip.  The syntax seems a bit out there, but I'll definitely
take a look and try that out too.

Thanks again,

David
-------
Cell: http://cellphone.duneram.com/index.html
Cam: http://www.duneram.com/cam/index.html
Tax: http://www.duneram.com/index.html




>From: Matteo Dell'Amico <della at toglimi.linux.it>
>To: python-list at python.org
>Subject: Re: Generators: section 9.10 of the python tutorial
>Date: Thu, 13 May 2004 19:14:24 GMT
>
>David Stockwell wrote:
>
>>What does this error mean?  Does it mean we can't use yield in our code?  
>>Is yield a form of a 'return' ??
>>
>>class9.py:71: Warning: 'yield' will become a reserved keyword in the 
>>future
>>  File "class9.py", line 71
>>    yield data[index]
>>             ^
>>SyntaxError: invalid syntax
>
>Yes, you can use yield. It's different from "return", but I guess I 
>couldn't explain it better then the tutorial. :-)
>You are probably using python2.2. If you want to create generators, you 
>need this line at the start of your python program:
>
>from __future__ import generators
>
>
>--
>http://mail.python.org/mailman/listinfo/python-list

_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE 
download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/





More information about the Python-list mailing list