From: Antoine Pitrou Date: Thu, 1 Mar 2012 15:28:14 +0000 (+0100) Subject: Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary, WeakValue... X-Git-Tag: v3.3.0a1~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0836baa46af9349b79976f751ac8d569cb256edf;p=python Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary, WeakValueDictionary) to return a better approximation when some objects are dead or dying. Moreover, the implementation is now O(1) rather than O(n). Thanks to Yury Selivanov for reporting. --- 0836baa46af9349b79976f751ac8d569cb256edf