On Sun, Nov 27, 2011 at 12:42 PM, candide <candide@free.invalid> wrote: > So, for the same reason, wouldn't it be better to use "if spam is True" > against to "if spam == True" (or better "if spam") ? >
They're quite different. "if spam" will check the truthiness of spam - it's equivalent to "if bool(spam) is True"; "if spam is True" checks that it's actually a boolean. But I would recommend against the "== True" form, as it's unclear which form you meant to use. (Others may disagree.) ChrisA -- http://mail.python.org/mailman/listinfo/python-list