Strange Behavior with Old-Style classes and implicit __contains__

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Thu Apr 12 06:23:08 CEST 2007


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?

-- 
Steven.




More information about the Python-list mailing list