This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Rhamphoryncus, rhettinger
Date 2008-05-08.04:06:39
SpamBayes Score 0.035783175
Marked as misclassified No
Message-id <1210219602.12.0.61405935643.issue2778@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-05-08 04:06:42rhettingersetspambayes_score: 0.0357832 -> 0.035783175
recipients: + rhettinger, Rhamphoryncus
2008-05-08 04:06:42rhettingersetspambayes_score: 0.0357832 -> 0.0357832
messageid: <1210219602.12.0.61405935643.issue2778@psf.upfronthosting.co.za>
2008-05-08 04:06:41rhettingerlinkissue2778 messages
2008-05-08 04:06:40rhettingercreate