Loop-and-a-half (Re: Curious assignment behaviour)

Tim Peters tim.one at home.com
Fri Oct 12 22:29:48 EDT 2001


[Tim]
> If people sign off on taking "then" as a new keyword, I think
> the chances are good that we could get
>
>     x = if e1 then e2 else e3
>
> into 2.2b1.  That's the only obvious spelling, hence the only truly
> Pythonic way to spell it.  Other languages spelling it that way range
> from Algol-60 (Guido's first intense language affair) to Haskell.

[Steve Holden]
> And so perhaps by extension
>
>     x = if e1 then e2 elif e3 then e4 else e5
>
> ?

I expect there's scant chance of that, just what I said at the top.

> Yet again starting to look a little Lispish.

    (cond (e1 e2) (e3 e4) (t e5))

isn't on the table either.

> Of course, eventually people will be posting asking us to debug
>
>     x = if if e1 then e2 else e3 then e4 else e5
>
> and similar. But then every language has its abusers <wink>.

You don't need to reply to them.  After nearly a decade of this, it occurred
to me that not every dumb-ass idea needs its day in court <wink>.

only-the-dumb-ass-ideas-you-like-ly y'rs  - tim





More information about the Python-list mailing list