Eric Lafontaine added the comment:

Hi,

For user-defined class, it's up to the class to do the right implementation in 
my opinion. It's true the description is wrong though. 

x in y means that x exist inside of y (so that the execution of 
y.__contain__(x) is executed successfully and (I guess) doesn't return 
None,False or 0).

I'll modify the doc to be :
For user-defined classes which define the __contains__() method, x in y is 
false if y.__contains__(x) is returning either None,False or 0.  Otherwise, x 
in y return true.

Regards,
Eric Lafontaine

----------
nosy: +Eric Lafontaine

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16011>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to