main logo
Subject: Re: [ProPython] Fwd: [Info] PEP 308 accepted - newconditional expressions
Author: Paul McNett

Posted: 2005/09/30 10:30:08
 
View Entire Thread
New Search


Ed Leafe wrote:
> On Sep 30, 2005, at 11:05 AM, Kevin Cully wrote:
>
>> Wow. I think this change really increases the readability of that
>> command. Of course, I'm not really of a Pythonista mindset yet.
>
>
> It looks like Fox's IIF() construct: a nice shorthand for
>
> if [test]:
> x = [some val]
> else:
> x = [some other val]

Initially, I ached for iif() in python, but the truth is the cases for
when this is more readable than writing out if...else are quite rare.
Python is already so terse. But that's cool, I'm sure I'll find a
handful of uses for this!

There is another PEP out there having to do with anonymous namespaces
that sounds much more interesting to me. This will give us the
functional equivilent of WITH...ENDWITH, which I definitely miss.

--
Paul McNett
http://paulmcnett.com
http://dabodev.com




 
©2005 Paul McNett
<-- Prior Message New Search Next Message -->