Raymond Hettinger | a690a99 | 2003-11-16 16:17:49 +0000 | [diff] [blame] | 1 | |
| 2 | /* Set object interface */ |
| 3 | |
| 4 | #ifndef Py_SETOBJECT_H |
| 5 | #define Py_SETOBJECT_H |
| 6 | #ifdef __cplusplus |
| 7 | extern "C" { |
| 8 | #endif |
| 9 | |
| 10 | /* |
| 11 | This data structure is shared by set and frozenset objects. |
| 12 | */ |
| 13 | |
| 14 | typedef struct { |
| 15 | PyObject_HEAD |
| 16 | PyObject *data; |
| 17 | long hash; /* only used by frozenset objects */ |
| 18 | } PySetObject; |
| 19 | |
| 20 | PyAPI_DATA(PyTypeObject) PySet_Type; |
| 21 | PyAPI_DATA(PyTypeObject) PyFrozenSet_Type; |
| 22 | |
Raymond Hettinger | f5f41bf | 2003-11-24 02:57:33 +0000 | [diff] [blame] | 23 | #define PyFrozenSet_CheckExact(ob) ((ob)->ob_type == &PyFrozenSet_Type) |
Raymond Hettinger | 50a4bb3 | 2003-11-17 16:42:33 +0000 | [diff] [blame] | 24 | #define PyAnySet_Check(ob) \ |
| 25 | ((ob)->ob_type == &PySet_Type || (ob)->ob_type == &PyFrozenSet_Type || \ |
| 26 | PyType_IsSubtype((ob)->ob_type, &PySet_Type) || \ |
| 27 | PyType_IsSubtype((ob)->ob_type, &PyFrozenSet_Type)) |
| 28 | |
Raymond Hettinger | a690a99 | 2003-11-16 16:17:49 +0000 | [diff] [blame] | 29 | #ifdef __cplusplus |
| 30 | } |
| 31 | #endif |
| 32 | #endif /* !Py_SETOBJECT_H */ |