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/2012-March/117468.html below:

[Python-Dev] FYI dict lookup now raises a RuntimeError if the dict is modified during the lookup

[Python-Dev] FYI dict lookup now raises a RuntimeError if the dict is modified during the lookup [Python-Dev] FYI dict lookup now raises a RuntimeError if the dict is modified during the lookupVictor Stinner victor.stinner at gmail.com
Fri Mar 9 13:48:35 CET 2012
If you use your own comparaison function (__eq__) for objects used as
dict keys, you may now get RuntimeError with Python 3.3 if the dict is
modified during a dict lookup in a multithreaded application. You
should use a lock on the dict to avoid this exception.

Said differently, a dict lookup is not atomic if you use your own
types as dict keys and these types implement __eq__.

In Python < 3.3, the dict lookup is retried until the dict is no more
modified during the lookup, which leads to a stack overflow crash if
the dict is always modified.

See the issue #14205 for the rationale.

Victor
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