Favorite non-python language trick?

Devan L devlai at gmail.com
Sun Jun 26 20:38:17 CEST 2005

< "return a if a.value == true"
< "database.query(q) unless database.connect == error

if a.value == True:
    return a

if not database.connect == error:

Trading two words for one word doesn't necessarily make the code

< unless false then print 1 # this prints 1 forever
while not False:
    print 1

"unless" seems to become "while not", as opposed to "if not". Should be
more consistent.

More information about the Python-list mailing list