Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a22e8bd

Browse filesBrowse files
committed
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.
1 parent 513b2ac commit a22e8bd
Copy full SHA for a22e8bd

17 files changed

+56-44Lines changed: 56 additions & 44 deletions
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Include/bytesobject.h‎

Copy file name to clipboardExpand all lines: Include/bytesobject.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ typedef struct {
2929

3030
/* Type object */
3131
PyAPI_DATA(PyTypeObject) PyBytes_Type;
32+
PyAPI_DATA(PyTypeObject) PyBytesIter_Type;
3233

3334
/* Type check macros */
3435
#define PyBytes_Check(self) PyObject_TypeCheck(self, &PyBytes_Type)
Collapse file

‎Include/descrobject.h‎

Copy file name to clipboardExpand all lines: Include/descrobject.h
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ typedef struct {
6767
void *d_wrapped; /* This can be any function pointer */
6868
} PyWrapperDescrObject;
6969

70+
PyAPI_DATA(PyTypeObject) PyClassMethodDescr_Type;
71+
PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type;
72+
PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;
73+
PyAPI_DATA(PyTypeObject) PyMethodDescr_Type;
7074
PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type;
75+
PyAPI_DATA(PyTypeObject) PyDictProxy_Type;
7176

7277
PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
7378
PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
Collapse file

‎Include/dictobject.h‎

Copy file name to clipboardExpand all lines: Include/dictobject.h
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,23 @@ struct _dictobject {
8989
};
9090

9191
PyAPI_DATA(PyTypeObject) PyDict_Type;
92+
PyAPI_DATA(PyTypeObject) PyDictIterKey_Type;
93+
PyAPI_DATA(PyTypeObject) PyDictIterValue_Type;
94+
PyAPI_DATA(PyTypeObject) PyDictIterItem_Type;
95+
PyAPI_DATA(PyTypeObject) PyDictKeys_Type;
96+
PyAPI_DATA(PyTypeObject) PyDictItems_Type;
97+
PyAPI_DATA(PyTypeObject) PyDictValues_Type;
9298

9399
#define PyDict_Check(op) \
94100
PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_DICT_SUBCLASS)
95101
#define PyDict_CheckExact(op) (Py_Type(op) == &PyDict_Type)
102+
#define PyDictKeys_Check(op) (Py_Type(op) == &PyDictKeys_Type)
103+
#define PyDictItems_Check(op) (Py_Type(op) == &PyDictItems_Type)
104+
#define PyDictValues_Check(op) (Py_Type(op) == &PyDictValues_Type)
105+
/* This excludes Values, since they are not sets. */
106+
# define PyDictViewSet_Check(op) \
107+
(PyDictKeys_Check(op) || PyDictItems_Check(op))
108+
96109

97110
PyAPI_FUNC(PyObject *) PyDict_New(void);
98111
PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);
Collapse file

‎Include/iterobject.h‎

Copy file name to clipboardExpand all lines: Include/iterobject.h
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ extern "C" {
66
#endif
77

88
PyAPI_DATA(PyTypeObject) PySeqIter_Type;
9+
PyAPI_DATA(PyTypeObject) PyCallIter_Type;
10+
PyAPI_DATA(PyTypeObject) PyZipIter_Type;
11+
PyAPI_DATA(PyTypeObject) PyCmpWrapper_Type;
912

1013
#define PySeqIter_Check(op) (Py_Type(op) == &PySeqIter_Type)
1114

1215
PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *);
1316

14-
PyAPI_DATA(PyTypeObject) PyCallIter_Type;
1517

1618
#define PyCallIter_Check(op) (Py_Type(op) == &PyCallIter_Type)
1719

Collapse file

‎Include/listobject.h‎

Copy file name to clipboardExpand all lines: Include/listobject.h
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ typedef struct {
3939
} PyListObject;
4040

4141
PyAPI_DATA(PyTypeObject) PyList_Type;
42+
PyAPI_DATA(PyTypeObject) PyListIter_Type;
43+
PyAPI_DATA(PyTypeObject) PyListRevIter_Type;
44+
PyAPI_DATA(PyTypeObject) PySortWrapper_Type;
4245

4346
#define PyList_Check(op) \
4447
PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_LIST_SUBCLASS)
Collapse file

‎Include/rangeobject.h‎

Copy file name to clipboardExpand all lines: Include/rangeobject.h
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ they are represented by a start, stop, and step datamembers.
1616
*/
1717

1818
PyAPI_DATA(PyTypeObject) PyRange_Type;
19+
PyAPI_DATA(PyTypeObject) PyRangeIter_Type;
20+
PyAPI_DATA(PyTypeObject) PyLongRangeIter_Type;
1921

2022
#define PyRange_Check(op) (Py_Type(op) == &PyRange_Type)
2123

Collapse file

‎Include/setobject.h‎

Copy file name to clipboardExpand all lines: Include/setobject.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ struct _setobject {
5858

5959
PyAPI_DATA(PyTypeObject) PySet_Type;
6060
PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;
61+
PyAPI_DATA(PyTypeObject) PySetIter_Type;
6162

6263
/* Invariants for frozensets:
6364
* data is immutable.
Collapse file

‎Include/stringobject.h‎

Copy file name to clipboardExpand all lines: Include/stringobject.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ typedef struct {
4040
} PyStringObject;
4141

4242
PyAPI_DATA(PyTypeObject) PyString_Type;
43+
PyAPI_DATA(PyTypeObject) PyStringIter_Type;
4344

4445
#define PyString_Check(op) \
4546
PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_STRING_SUBCLASS)
Collapse file

‎Include/tupleobject.h‎

Copy file name to clipboardExpand all lines: Include/tupleobject.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ typedef struct {
3232
} PyTupleObject;
3333

3434
PyAPI_DATA(PyTypeObject) PyTuple_Type;
35+
PyAPI_DATA(PyTypeObject) PyTupleIter_Type;
3536

3637
#define PyTuple_Check(op) \
3738
PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_TUPLE_SUBCLASS)
Collapse file

‎Include/unicodeobject.h‎

Copy file name to clipboardExpand all lines: Include/unicodeobject.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ typedef struct {
417417
} PyUnicodeObject;
418418

419419
PyAPI_DATA(PyTypeObject) PyUnicode_Type;
420+
PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
420421

421422
#define SSTATE_NOT_INTERNED 0
422423
#define SSTATE_INTERNED_MORTAL 1

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.