Raymond Hettinger <[EMAIL PROTECTED]> added the comment:

Rejecting this patch which simply disables a feature that some users 
consider to be important.

I will look at it further.  Right now, I'm inclined to simply document 
that the three temporary autoconversions deny meaningful 
contemporaneous access to a set used as a key.

The set_swap_bodies() function itself is fine -- it behaves just like 
an atomic version of the pure python sequence:  t=set(a); a.clear(); 
a.update(b); b.clear(); b.update(t); del t.

The issue is simply that the swap/search/swap dance allows the 
possibility that a determined user could graft onto the search step and 
access but not modify the temporary swapped-in frozenset. It doesn't 
crash; it simply produces an undefined result.  I'm not losing sleep 
over this scenario.

I'm am entertaining an alternative where contains/discard/remove would 
duplicate instead of swap the set bodies; however, that approach may do 
more harm than good.

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2778>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to