mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Added all PyTypeObjects to the appropriate header files.
Before the patch a lot of internal types weren't available in the header files. The patch exposes the new iterators, views and some other types to all C modules. I've also renamed some of the types and tp_names.
This commit is contained in:
parent
513b2ac76c
commit
a22e8bdfd9
17 changed files with 56 additions and 44 deletions
|
|
@ -89,10 +89,23 @@ struct _dictobject {
|
|||
};
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyDict_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyDictIterKey_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyDictIterValue_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyDictIterItem_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyDictKeys_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyDictItems_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyDictValues_Type;
|
||||
|
||||
#define PyDict_Check(op) \
|
||||
PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_DICT_SUBCLASS)
|
||||
#define PyDict_CheckExact(op) (Py_Type(op) == &PyDict_Type)
|
||||
#define PyDictKeys_Check(op) (Py_Type(op) == &PyDictKeys_Type)
|
||||
#define PyDictItems_Check(op) (Py_Type(op) == &PyDictItems_Type)
|
||||
#define PyDictValues_Check(op) (Py_Type(op) == &PyDictValues_Type)
|
||||
/* This excludes Values, since they are not sets. */
|
||||
# define PyDictViewSet_Check(op) \
|
||||
(PyDictKeys_Check(op) || PyDictItems_Check(op))
|
||||
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyDict_New(void);
|
||||
PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue