Inline Conditionals?

John J. Lee jjl at pobox.com
Thu Aug 26 15:40:23 EDT 2004


aleaxit at yahoo.com (Alex Martelli) writes:
[...]
> Of course, absit iniuria verbis, one cannot make anything foolproof,
> because fools are SO ingenious -- I've also seen lots of code like:
> 
>     if x < 0:
>         return True
>     else:
>         return False
> 
> which is, si licet es, even _worse_ than the wished-for ternary use!-)
[...]

Argh.

I looked at that, and had a sinking feeling.  I just found about ten
instances of that in my code!

Strange that, though I was innoculated against the general case of
this disease in the some years ago, I was apparently still entirely
susceptible to this particular strain of it.


John



More information about the Python-list mailing list