Bugs item #1466641, was opened at 2006-04-07 18:51 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1466641&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Parser/Compiler Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Nobody/Anonymous (nobody) Summary: Bogus SyntaxError in listcomp Initial Comment: The attached syn.py gives a SyntaxError in 2.5a1 and trunk. Works fine in earlier Pythons. Whittled down from real-life Zope3 source. def d(dir): return [fn for fn in os.listdir(dir) if fn if fn] ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2006-04-09 00:07 Message: Logged In: YES user_id=31435 The whittled-down version looks ridiculous, but the original wasn't quite such an affront to beauty :-) It's really no stranger than allowing pure "if" statements to nest, and it would be more painful to contort the grammar to disallow it (I haven't looked at the 2.5 parser, but it was very surprising to me that it didn't allow it!). ---------------------------------------------------------------------- Comment By: Nick Coghlan (ncoghlan) Date: 2006-04-08 23:32 Message: Logged In: YES user_id=1038590 Is including two if clauses with a single for clause really meant to be legal? *goes and looks at language reference* Wow. What a strange way to write "and". . . ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1466641&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com