On Apr 16, 1:24 pm, candide <cand...@free.invalid> wrote:
> Consider the following code :
>
> # --------------------------------------
> def bool_equivalent(x):
>      return True if x else False

It's faster to write:

def bool_equivalent(x):
    return not not x


Raymond
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to