Names changed to protect the guilty

Ben Finney bignose+hates-spam at benfinney.id.au
Sat Oct 7 21:14:21 EDT 2006


jjl at pobox.com (John J. Lee) writes:

> aahz at pythoncraft.com (Aahz) writes:
> >     if schema.elements.has_key(key) is False:
>
> 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.

Apparently a reason unrelated to dict.has_key, which is documented as
returning only True or False, never None.

-- 
 \     "Welchen Teil von 'Gestalt' verstehen Sie nicht?  [What part of |
  `\             'gestalt' don't you understand?]"  -- Karsten M. Self |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list