A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-September/082387.html below:

[Python-Dev] Weak Dictionary Iteration Behavior in Python 3

[Python-Dev] Weak Dictionary Iteration Behavior in Python 3 [Python-Dev] Weak Dictionary Iteration Behavior in Python 3Antoine Pitrou solipsis at pitrou.net
Sun Sep 14 15:48:05 CEST 2008
Nick Coghlan <ncoghlan <at> gmail.com> writes:
> 
> I agree this is a problem, but I'm struggling to think of possible
> solutions that aren't either horrendously complicated or completely
> contrary to the idea of view-based dicts.

Keeping a count of the number of views currently alive for a given weak dict
doesn't seem "horrendously complicated" (*). Once this count falls to zero, you
can purge all the dead weakrefs from the dict (their keys would have been
previously queued, so that purging is O(dead weakrefs) and not O(dict length)).

(*) the most complicated is probably to write the view classes themselves


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4