Ezio Melotti added the comment: The colon is the first invalid char, for example this is valid python and works: >>> things = ['a', 'b'] >>> things.append('c' ... for a in things) >>> things ['a', 'b', <generator object <genexpr> at 0xb76dacfc>]
In your case Python expects a genexp like things.append('c' for a in things), and when it finds the ':' it gives error. If you use e.g. a 'while', you will see the error earlier: >>> things = ['a', 'b'] >>> things.append('c' ... while True: File "<stdin>", line 2 while True: ^ SyntaxError: invalid syntax ---------- nosy: +ezio.melotti resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16917> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com