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/082381.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 3Armin Ronacher armin.ronacher at active-4.com
Sun Sep 14 11:39:31 CEST 2008
Hi,

Adam Olsen <rhamph <at> gmail.com> writes:

> IMO, this is a deeper problem than suggested.  As far as I know,
> python does not (and should not) make promises as to when it'll
> collect object.  We should expect weakrefs to be cleared at random
> points, and code defensively.
It doesn't promise when objects are collected and that's not the problem
here.  The main problem is that the old solution for weakrefs relayed on
the fact that .keys() was considered atomic.  I don't say it has to
become again, but the weak dictionaries have to somehow counter that
problem.  They could for example only remove items from the internal dict
if no dict view to that dict is alive.

Speaking of atom keys() / values() / items() operations: I guess we will
see more of those problems in threaded situations when people start to
convert code over to Python.  I've seen quite a few situations where code
relays on keys() holding the interpreter lock.

Regards,
Armin

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