Strange Behavior with Old-Style classes and implicit __contains__

Scott David Daniels scott.daniels at acm.org
Thu Apr 12 00:33:54 EDT 2007


Steven D'Aprano wrote:
> On Wed, 11 Apr 2007 16:37:35 -0700, rconradharris wrote:
> ...
> Here are the results under Python 2.5:
> 
>>>> tester(10)
> Checking index 0...
> Checking index 0...
> Checking index 0...
> Checking index 0...
> Checking index 0...
> [False, 'KeyError', False, 'KeyError', False, 
> 'KeyError', False, 'KeyError', False, 'KeyError']
> 
> 
> And here are the results under Python 2.4.3:
> 
>>>> tester(10)
[works]
> 
> Looks like a bug to me.

No problem with 2.5.1c1 here.

--Scott David Daniels
scott.daniels at acm.org



More information about the Python-list mailing list