Wolfgang Maier added the comment:

> l=[myObj() for x in range(10000)]
> 
> now compare:
> 
> >>> 1 in m # slowed down by myObj.__eq__
> False
> 
> >>> any(e is 1 for e in m) # identity checks only
> False

oops, sorry for the inconsistency here.

the first line should read:

m = [myObj() for x in range(10000)]

for this to work, of course.

----------

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

Reply via email to