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

Erik Max Francis max at alcyone.com
Mon Feb 10 06:51:39 CET 2003


Andrew Dalke wrote:

>            if (b->ob_ref == NULL)
>                    return 0;
>            return -1;
> 
> This could be written in C as
> 
>    return  b->ob_ref == NULL ? 1 : 0

Pretty sure it can't be rewritten _that_ way :-).

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ She glanced at her watch ... It was 9:23.
\__/ James Clavell
    Bosskey.net: Quake III Arena / http://www.bosskey.net/q3a/
 A personal guide to Quake III Arena.




More information about the Python-list mailing list