Antoine Pitrou added the comment: > Now about __len__() returning a wrong result: it is a more complicated issue, > I fear. I already patched weakref.py inside PyPy in order to pass a unit > test inside CPython's test suite. This patch is to change __len__ to look > like this: [...]
Thanks for the explanation. Yes, you are right on the principle. But there is also a general expectation that len() on an in-memory container is a O(1) operation, not O(n) - this change would break that expectation quite heavily. I don't know how to fix len() without losing O(1) performance. It seems we're in a bit of a quandary on this topic. However, we can still fix the other issues. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28427> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com