On 11/19/2010 12:17 PM, Johannes Bauer wrote: > Am 15.11.2010 18:27, schrieb Duncan Booth: > >> Comparing directly against True or False is error prone: a value in >> Python can be false without actually being equal to False. > > Well, you can always use "is" instead of "==", which makes a comparison > to True or False perfectly safe. > But it's still the wrong thing to do.
if condition==True: and if condition is True: should both be replaced (under most circumstances) by if condition: regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 PyCon 2011 Atlanta March 9-17 http://us.pycon.org/ See Python Video! http://python.mirocommunity.org/ Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list