On Thu, Nov 22, 2007 at 06:47:33AM +0000, Marc 'BlackJack' Rintsch wrote 
regarding Re: why it is invalid syntax?:
> 
> It's quite unreadable and if this would be allowed you would have to
> introduce a special rule to forbid ``else``, ``except`` and ``finally``
> because it can lead to ambiguities. To which ``if`` does the ``else``
> belong to here? ::
> 
>   if 1: print 1 if: 1 print 1 else: print 1
> 
> Ciao,
>       Marc 'BlackJack' Rintsch

I don't reckon in matters much.  Your output will be:

1
1

;)

No, actually on second inspection your output will be:

File "<stdin>", line 1
if 1: print 1 if: 1 print 1 else: print 1
                ^
SyntaxError: invalid syntax

But it's a good point.

Cheers,
Cliff
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to