New submission from Jim Jewett <jimjjew...@gmail.com>:

Per the 3.3 WhatsNew:
"""issue 14205: A dict lookup now raises a RuntimeError if the dict is modified 
during the lookup. If you implement your own comparison function for objects 
used as dict keys and the dict is shared by multiple threads, access to the 
dict should be protected by a lock."""

This should be easier to do.  My suggestion would be that the change to 
(general) lookdict (or possibly an additional transition, if you want a 
less-slow path for non-string non-container builtins) create the lock, and 
acquire/release that lock.  At a minimum, there should be a dict subclass that 
does this.

[Note that this is arguably a regression, since previous python versions would 
just retry, which would be enough to protect innocent but unlucky code.]

----------
messages: 156843
nosy: Jim.Jewett
priority: normal
severity: normal
status: open
title: dict RuntimeError workaround
type: enhancement
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14417>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to