diff options
author | Raymond Hettinger <python@rcn.com> | 2005-08-16 03:47:52 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-08-16 03:47:52 (GMT) |
commit | beb3101b051e415cb18ba844e0187a8caa7ac3fd (patch) | |
tree | 999f1f843ca5b7b67f668fc3ac970e239dd3a4ec /Include | |
parent | e2eca0b709451e6956d7c84658e9c29037be7c0c (diff) | |
download | cpython-beb3101b051e415cb18ba844e0187a8caa7ac3fd.zip cpython-beb3101b051e415cb18ba844e0187a8caa7ac3fd.tar.gz cpython-beb3101b051e415cb18ba844e0187a8caa7ac3fd.tar.bz2 |
Add a C API for sets and frozensets.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/setobject.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Include/setobject.h b/Include/setobject.h index 6a829f0..b6849e1 100644 --- a/Include/setobject.h +++ b/Include/setobject.h @@ -74,6 +74,15 @@ PyAPI_DATA(PyTypeObject) PyFrozenSet_Type; PyType_IsSubtype((ob)->ob_type, &PySet_Type) || \ PyType_IsSubtype((ob)->ob_type, &PyFrozenSet_Type)) +PyAPI_FUNC(PyObject *) PySet_New(PyObject *); +PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *); +PyAPI_FUNC(int) PySet_Size(PyObject *anyset); +#define PySet_GET_SIZE(so) (((PySetObject *)(so))->used) +PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key); +PyAPI_FUNC(int) PySet_Discard(PyObject *anyset, PyObject *key); +PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key); +PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set); + #ifdef __cplusplus } #endif |