[Tutor] summer_v04.py
Kent Johnson
kent37 at tds.net
Wed Feb 21 14:11:13 CET 2007
Rikard Bosnjakovic wrote:
> On 2/21/07, John Fouhy <john at fouhy.net> wrote:
>
>> (because you are using a generator expression, and they were only
>> introduced in 2.4)
>
> List comprehensions were implemented in v2.0. The OP probably does not
> use an older version, but as far as I can see, his syntax error line
> uses parenthesis - not brackets - hence the error.
Without the brackets it is a generator expression, as John correctly
notes. Generator expressions were introduced in Python 2.4:
http://www.python.org/doc/2.4.4/whatsnew/node4.html
Kent
More information about the Tutor
mailing list