Strange Behavior with Old-Style classes and implicit __contains__

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Apr 12 00:58:03 EDT 2007


En Thu, 12 Apr 2007 01:23:08 -0300, Steven D'Aprano  
<steve at REMOVE.THIS.cybersource.com.au> escribió:

> On Thu, 12 Apr 2007 00:32:32 -0300, Gabriel Genellina wrote:
>
>> First I want to say that __getitem__ should raise IndexError, not
>> KeyError, to indicate "not found"
>
> How do you know the Original Poster's class was meant to be a sequence
> rather than a mapping?

Ouch, no, sorry, disregard that comment.

-- 
Gabriel Genellina




More information about the Python-list mailing list