[issue2778] set_swap_bodies is unsafe

Raymond Hettinger report at bugs.python.org
Wed May 14 22:59:12 CEST 2008


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

By replacing temporary immutability with temporary hashability, does 
this approach create the possibility that someone could mutate the key-
set during a search?  Is it possible to get the __eq__ check out-of-
sync with the __hash__ value?

Also, after a quick look at the patch, I'm not too keen on any 
modifications to set_swap_bodies() nor with changing the signature of 
set_contains_key().

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2778>
__________________________________


More information about the Python-bugs-list mailing list