Names changed to protect the guilty

Neil Cerutti horpner at yahoo.com
Sat Oct 7 07:25:59 EDT 2006


On 2006-10-07, MonkeeSage <MonkeeSage at gmail.com> wrote:
>
> On Oct 6, 8:34 pm, Neil Cerutti <horp... at yahoo.com> wrote:
>> And in the original case, I'd agree that "if X.has_key():" is
>> quite clear, already yielding a boolian value, and so doesn't
>> need to be tested for if it's False. But I wouldn't like to
>> test for an empty list or for None implicitly.
>
> I agree that predicates are explicit in themselves, if they are
> named intuitively like "has_key". I assumed that the OP was
> upset about "is False" not that an explicit check was done on a
> predicate method.

And that's something that I'd never have written, and wouldn't
have recognized as a bug until this thread. I can hear the gears
clicking in there now. Thanks to you and other that explained
this bug properly.

-- 
Neil Cerutti



More information about the Python-list mailing list