"Aahz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In article <[EMAIL PROTECTED]>, Antoon Pardon > <[EMAIL PROTECTED]> wrote: >> >>The problem is there is also ground for bugs if you don't use "blah is >>True". If some application naturally seems to ask for a variable that >>can be valued False, True or a positive integer then things like "if >>var" or "if not var" may very well be a bug too. > > Anyone designing an app like that in Python deserves to lose. It's just > another way of shooting yourself in the foot.
OK, I guess nobody ever heard about three-valued logic before, right? Of course it does not apply to the original post because has_key() can only return True or False (I hope it will not ever return DontKnow:) but in general if you implement something like 3-valued logic choices like (False,True,None) are almost obvious. Andy. -- http://mail.python.org/mailman/listinfo/python-list