Robert Schuppenies <robert.schuppen...@gmail.com> added the comment:
Here is a patch which will return False instead of TypeError. This is the same behavior a normal set has. Two things though. 1. I don't know wether the 'import _abcoll' statement somehow influences the bootstrap in one way or the other, because 'from _abcoll import Iterable' does. 2. The current WeakSet implementation returns True if a WeakSet is compared to any Iterable which contains the same set of objects: >>> import weakref >>> >>> class Foo: pass ... >>> l = [Foo(), Foo(), Foo()] >>> ws = weakref.WeakSet(l) >>> ws == l True Not sure wether this is intended, since this is not the same behavior of a normal set. If it is intended, I think it should be documented. ---------- keywords: +needs review, patch Added file: http://bugs.python.org/file13955/_weakrefset.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5964> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com