File indexing completed on 2025-01-18 10:06:49
0001 #ifndef Py_DICTOBJECT_H
0002 #define Py_DICTOBJECT_H
0003 #ifdef __cplusplus
0004 extern "C" {
0005 #endif
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 PyAPI_DATA(PyTypeObject) PyDict_Type;
0016
0017 #define PyDict_Check(op) \
0018 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)
0019 #define PyDict_CheckExact(op) Py_IS_TYPE((op), &PyDict_Type)
0020
0021 PyAPI_FUNC(PyObject *) PyDict_New(void);
0022 PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);
0023 PyAPI_FUNC(PyObject *) PyDict_GetItemWithError(PyObject *mp, PyObject *key);
0024 PyAPI_FUNC(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item);
0025 PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key);
0026 PyAPI_FUNC(void) PyDict_Clear(PyObject *mp);
0027 PyAPI_FUNC(int) PyDict_Next(
0028 PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value);
0029 PyAPI_FUNC(PyObject *) PyDict_Keys(PyObject *mp);
0030 PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp);
0031 PyAPI_FUNC(PyObject *) PyDict_Items(PyObject *mp);
0032 PyAPI_FUNC(Py_ssize_t) PyDict_Size(PyObject *mp);
0033 PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp);
0034 PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key);
0035
0036
0037 PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other);
0038
0039
0040
0041
0042
0043
0044 PyAPI_FUNC(int) PyDict_Merge(PyObject *mp,
0045 PyObject *other,
0046 int override);
0047
0048
0049
0050
0051
0052
0053 PyAPI_FUNC(int) PyDict_MergeFromSeq2(PyObject *d,
0054 PyObject *seq2,
0055 int override);
0056
0057 PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, const char *key);
0058 PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item);
0059 PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key);
0060 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
0061 PyAPI_FUNC(PyObject *) PyObject_GenericGetDict(PyObject *, void *);
0062 #endif
0063
0064
0065
0066 PyAPI_DATA(PyTypeObject) PyDictKeys_Type;
0067 PyAPI_DATA(PyTypeObject) PyDictValues_Type;
0068 PyAPI_DATA(PyTypeObject) PyDictItems_Type;
0069
0070 #define PyDictKeys_Check(op) PyObject_TypeCheck((op), &PyDictKeys_Type)
0071 #define PyDictValues_Check(op) PyObject_TypeCheck((op), &PyDictValues_Type)
0072 #define PyDictItems_Check(op) PyObject_TypeCheck((op), &PyDictItems_Type)
0073
0074 # define PyDictViewSet_Check(op) \
0075 (PyDictKeys_Check(op) || PyDictItems_Check(op))
0076
0077
0078
0079 PyAPI_DATA(PyTypeObject) PyDictIterKey_Type;
0080 PyAPI_DATA(PyTypeObject) PyDictIterValue_Type;
0081 PyAPI_DATA(PyTypeObject) PyDictIterItem_Type;
0082
0083 PyAPI_DATA(PyTypeObject) PyDictRevIterKey_Type;
0084 PyAPI_DATA(PyTypeObject) PyDictRevIterItem_Type;
0085 PyAPI_DATA(PyTypeObject) PyDictRevIterValue_Type;
0086
0087
0088 #ifndef Py_LIMITED_API
0089 # define Py_CPYTHON_DICTOBJECT_H
0090 # include "cpython/dictobject.h"
0091 # undef Py_CPYTHON_DICTOBJECT_H
0092 #endif
0093
0094 #ifdef __cplusplus
0095 }
0096 #endif
0097 #endif