[EMAIL PROTECTED] (Aahz) writes: > The following line of lightly munged code was found in a publicly > available Python library... > > if schema.elements.has_key(key) is False: > > Sorry, just had to vent.
I think I was reading the same code recently (epydoc?) and was also momentarily horrified ;-) until I realized that it was quite deliberately using three-valued logic (True, False, None) for some presumably-sensible reason. Since None is false, they had to use "is". So, given the need for three-valued logic, it's not as silly as it looks. John -- http://mail.python.org/mailman/listinfo/python-list