conditional expressions (RE: Loop-and-a-half (Re: Curious assignment behaviour))
maj64 at hotmail.com
Mon Oct 15 21:46:11 CEST 2001
"Tim Peters" <tim.one at home.com> wrote
> It's a conditional expresssion -- that's all. It's been debated for years,
> on Python-Dev most persistenly by Eric Raymond. It came up in internal
> PythonLabs discussions late last week, as an offshoot of a "should we try to
> reserve any other keywords for 2.2?" discussion. Guido figured it was time
> to at least try it, fiddled the grammar for if/then/else, and I implemented
> it over the weekend. It has not been checked in yet. If it turns into a
> time sink (which it is on the edge of becoming), it will go away (if it's
> not in 2.2b1 later this week, it won't go in at all).
I vote for it, parens and all.
Plus we get conditionals inside lambda expressions for free...
More information about the Python-list