Defending the ternary operator

Andrew Dalke adalke at
Mon Feb 10 09:35:25 CET 2003

> > 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
> 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.

                    dalke at

More information about the Python-list mailing list