Add a C API for sets and frozensets.

This commit is contained in:
Raymond Hettinger 2005-08-16 03:47:52 +00:00
parent e2eca0b709
commit beb3101b05
5 changed files with 210 additions and 12 deletions

View file

@ -773,11 +773,9 @@ r_object(RFILE *p)
if (v == NULL)
return v;
if (type == TYPE_SET)
v3 = PyObject_CallFunctionObjArgs(
(PyObject *)&PySet_Type, v, NULL);
v3 = PySet_New(v);
else
v3 = PyObject_CallFunctionObjArgs(
(PyObject *)&PyFrozenSet_Type, v, NULL);
v3 = PyFrozenSet_New(v);
Py_DECREF(v);
return v3;