Le 18/04/2011 10:33, Raymond Hettinger a écrit :

# --------------------------------------
def bool_equivalent(x):
      return True if x else False

It's faster to write:

def bool_equivalent(x):
     return not not x



faster and ... smarter ;)
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to