Defending the ternary operator

Andrew Dalke adalke at mindspring.com
Mon Feb 10 03:35:25 EST 2003


Me:
> > Oh yeah, and you should also check for
> >      if <something>:
> >        return <some value>
> >      return <some other value>
> > Which is also more common in C code compared to
> >      return something ? some_value : some_other_value;

Paul Paterson
> Wait, I thought that conditional expressions were supposed to reduce the
> cognitive overload and now here I am having to think up weird and
wonderful
> regular expressions to try to evaluate the cognitive benefit... <wink>

Well, they don't (usually) and you could always modify gcc to generate
that information for you instead of using regexps.

Ahh, sometimes I'm just too funny for words.

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list