A defense for bracket-less code
Carl Banks
invalidemail at aerojockey.com
Wed Apr 26 17:33:00 EDT 2006
More information about the Python-list mailing list
Wed Apr 26 17:33:00 EDT 2006
- Previous message (by thread): A defense for bracket-less code
- Next message (by thread): modifying iterator value.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Edward Elliott wrote:
> Stelios Xanthakis wrote:
> > Also, I think that perl does that because otherwise code like
> >
> > if ($x) $y++ if $z; else $z--;
> >
> > would be even more confusing :)
>
> With or without braces, that's not legal code. A one-line if can't be
> followed by an else.
Thus proving the original claim about it being confusing. :) I think
he intended it to parse this way:
if ($x) { $y++ if $z; } else { $z--; }
Carl Banks
- Previous message (by thread): A defense for bracket-less code
- Next message (by thread): modifying iterator value.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list