For review: PEP 308 - If-then-else expression

Jp Calderone exarkun at intarweb.us
Fri Feb 7 22:13:21 EST 2003


On Fri, Feb 07, 2003 at 07:15:06PM -0600, Ian Bicking wrote:
> [snip]
> 
> Yes!  That is very readable.  Besides the fact I haven't thought about
> the quadriatic equation in years, this was very easy to read and
> understand.  I use this pattern all the time:
> 
> if x:
>     val = y
> else:
>     val = z
> 
> And I *hate* it.

  Try this one on for size:

    val = z
    if x:
        val = y

  Jp

-- 
Seduced, shaggy Samson snored.
She scissored short.  Sorely shorn,
Soon shackled slave, Samson sighed,
Silently scheming,
Sightlessly seeking
Some savage, spectacular suicide.
                -- Stanislaw Lem, "Cyberiad"
-- 
 up 54 days, 7:50, 3 users, load average: 0.00, 0.01, 0.00
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030207/5b442dcd/attachment.sig>


More information about the Python-list mailing list