1-line idiom to replace if blocks

Y2KYZFR1 jarrodhroberson at yahoo.com
Thu Jan 23 23:05:41 EST 2003


"Jonathan P." <jbperez808 at yahoo.com> wrote in message news:<3e2cf624 at post.usenet.com>...
> **** Post for FREE via your newsreader at post.usenet.com ****
> 
> I hate code that takes up too many lines and
> have come up with the ff. idiom to replace
> many 4 line if statements:
> 
> result=[value-if-false,value-if-true][condition]
> 
> This idea could also be applied as a compact
> switch block replacement in certain cases.
> 

God I feel sorry for anyone that has to come behind you and work on
any code you ever write. If you are this lazy not to write out a
simple if statement where other people can come behind you and
understand it.

The entire idea behind Python even more so than other languages is
maintance and readablity and you whack jobs just insist on making it
convoluted and obfuscated!

It does not show how clever you are, just how lazy and inconsiderate
you are. I have fired people for less than this personally!




More information about the Python-list mailing list