
report at bugs
Mar 6, 2012, 9:21 AM
Views: 245
Permalink
|
|
[issue14205] Raise an error if a dict is modified during a lookup
[In reply to]
|
|
Guido van Rossum <guido [at] python> added the comment: On Tue, Mar 6, 2012 at 8:56 AM, Mark Shannon <report [at] bugs> wrote: > > Mark Shannon <mark [at] hotpy> added the comment: > > Jim Jewett wrote: >> Jim Jewett <jimjjewett [at] gmail> added the comment: >> >> Can't this be triggered by non-malicious code that just happened to have a python comparison and get hit with a thread switch? > > So, they are writing to a dict in one thread while reading from the same > dict in another thread, without any external locks and with keys written > in Python. >> >> I'm not sure how often it happens, but today it would not be visible to the user; after the patch, users will see a sporadic failure that they can't easily defend against. >> > I suspect, they are already seeing sporadic failures. > I think raising an exception is better than weird failures. > > We should document the new behaviour, as it is a change in semantics. +1 on everything you said. ---------- _______________________________________ Python tracker <report [at] bugs> <http://bugs.python.org/issue14205> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
|