Adam Olsen <[EMAIL PROTECTED]> added the comment:

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.

Added file: http://bugs.python.org/file10315/python-setswap-2.diff

__________________________________
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