SF patch #1458476 with modifications based on discussions in python-dev.  This
adds the following API calls: PySet_Clear(), _PySet_Next(), and
_PySet_Update().  The latter two are considered non-public.  Tests and
documentation (for the public API) are included.
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 6ff1215..1a2cdda 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -421,7 +421,7 @@
         self.assertRaises(ReferenceError, str, p)
 
     # C API test only available in a debug build
-    if hasattr(sys, "gettotalrefcount"):
+    if hasattr(set, "test_c_api"):
         def test_c_api(self):
             self.assertEqual(set('abc').test_c_api(), True)