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 Rhamphoryncus
Recipients Rhamphoryncus, rhettinger
Date 2008-05-13.06:30:46
SpamBayes Score 0.12287866
Marked as misclassified No
Message-id <1210660276.98.0.769847211696.issue2778@psf.upfronthosting.co.za>
In-reply-to
Content
Here's another approach to avoiding set_swap_bodies.  The existing
semantics are retained.  Rather than creating a temporary frozenset and
swapping the contents, I check for a set and call the internal hash
function directly (bypassing PyObject_Hash).

I even retain the current semantics of PySet_Discard and PySet_Contains,
which do NOT do the implicit conversion (and have unit tests to verify
that!)

I do have some concern that calling PySet_Check on every call may be too
slow.  It may be better to only call it on failure (which is
more-or-less what the old code did.)

set_swap_bodies has only one remaining caller, and their use case could
probably be significantly simplified.
History
Date User Action Args
2008-05-13 06:31:18Rhamphoryncussetspambayes_score: 0.122879 -> 0.12287866
recipients: + Rhamphoryncus, rhettinger
2008-05-13 06:31:17Rhamphoryncussetspambayes_score: 0.122879 -> 0.122879
messageid: <1210660276.98.0.769847211696.issue2778@psf.upfronthosting.co.za>
2008-05-13 06:31:15Rhamphoryncuslinkissue2778 messages
2008-05-13 06:31:14Rhamphoryncuscreate