En Mon, 09 Mar 2009 07:15:30 -0200, pang <pablo.ang...@uam.es> escribió:

  This is an idea about something I'd like to see implemented in
python.

The python-ideas list exists to discuss this sort of things.

The syntax of a for loop is restricted to the following:
   for element in list:
       instructions

Note that "list" in your description may be any expression list, in particular a conditional expression. This is currently valid:

for e in iterable1 if cond else iterable2:
  do something

In your proposal, depending whether there is an "else" clause or not, the "if" should be attached to the expression or the for statement. I'm unsure if this still can be represented as an LL(1) grammar (and Guido always said he wants the grammar to stay LL(1)).

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to