Aahz wrote:
> 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.
> --
> Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
Uh, guys. IMO, the clearest way of writing this is:
if key not in schema.elements:
whatever...
Unless, of course, your code has to run in a
Python release earlier than 2.2. But then you
wouldn't be testing for the False object anyway.
John Roth