Skip to content

Commit 0d06cce

Browse files
Don't expose implementation details.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent 1c2797f commit 0d06cce

File tree

6 files changed

+30
-39
lines changed

6 files changed

+30
-39
lines changed

Doc/c-api/bytearray.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ Byte Array Objects
1919
it is the same object as :class:`bytearray` in the Python layer.
2020

2121

22-
.. c:var:: PyTypeObject PyByteArrayIter_Type
23-
24-
Type object for an iterator over a :class:`bytearray` object. Instances
25-
of this object are returned by :meth:`!bytearray.__iter__`.
26-
27-
2822
Type check macros
2923
^^^^^^^^^^^^^^^^^
3024

Doc/c-api/bytes.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ called with a non-bytes parameter.
2222
is the same object as :class:`bytes` in the Python layer.
2323

2424

25-
.. c:var:: PyTypeObject PyBytesIter_Type
26-
27-
Type object for an iterator over a :class:`bytes` object. Instances
28-
of this object are returned by :meth:`!bytes.__iter__`.
29-
30-
3125
.. c:function:: int PyBytes_Check(PyObject *o)
3226
3327
Return true if the object *o* is a bytes object or an instance of a subtype

Doc/c-api/iterator.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,33 @@ sentinel value is returned.
5050
callable object that can be called with no parameters; each call to it should
5151
return the next item in the iteration. When *callable* returns a value equal to
5252
*sentinel*, the iteration will be terminated.
53+
54+
55+
Other Iterator Objects
56+
^^^^^^^^^^^^^^^^^^^^^^
57+
58+
.. c:var:: PyTypeObject PyByteArrayIter_Type
59+
.. c:var:: PyTypeObject PyBytesIter_Type
60+
.. c:var:: PyTypeObject PyListIter_Type
61+
.. c:var:: PyTypeObject PyListRevIter_Type
62+
.. c:var:: PyTypeObject PySetIter_Type
63+
.. c:var:: PyTypeObject PyTupleIter_Type
64+
.. c:var:: PyTypeObject PyRangeIter_Type
65+
.. c:var:: PyTypeObject PyLongRangeIter_Type
66+
.. c:var:: PyTypeObject PyDictIterKey_Type
67+
.. c:var:: PyTypeObject PyDictRevIterKey_Type
68+
.. c:var:: PyTypeObject PyDictIterValue_Type
69+
.. c:var:: PyTypeObject PyDictRevIterValue_Type
70+
.. c:var:: PyTypeObject PyDictIterItem_Type
71+
.. c:var:: PyTypeObject PyDictRevIterItem_Type
72+
73+
Type objects for iterators of various built-in objects.
74+
75+
Do not create instances of these directly; prefer calling
76+
:func:`PyObject_GetIter` instead.
77+
78+
Note that there is no guarantee that a given built-in type uses a given iterator
79+
type. For example, iterating over :class:`range` will use one of two iterator
80+
types depending on the size of the range. Other types may start using a
81+
similar scheme in the future, without warning.
82+

Doc/c-api/list.rst

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -181,18 +181,3 @@ List Objects
181181
182182
Return a new tuple object containing the contents of *list*; equivalent to
183183
``tuple(list)``.
184-
185-
List Iterators
186-
^^^^^^^^^^^^^^
187-
188-
189-
.. c:var:: PyTypeObject PyListIter_Type
190-
191-
Type object for an iterator over a :class:`list` object. Instances
192-
of this object are returned by :meth:`!bytes.__iter__`.
193-
194-
195-
.. c:var:: PyTypeObject PyListRevIter_Type
196-
197-
Type object for a reversed iterator over a :class:`list` object.
198-
Instances of this object are returned by :meth:`!bytes.__reversed__`.

Doc/c-api/set.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ the abstract object protocol (including :c:func:`PyObject_CallMethod`,
4141
:class:`set` type.
4242

4343

44-
.. c:var:: PyTypeObject PySetIter_Type
45-
46-
Type object for an iterator over a :class:`set` object. Instances
47-
of this object are returned by :meth:`!set.__iter__`.
48-
49-
5044
.. c:var:: PyTypeObject PyFrozenSet_Type
5145
5246
This is an instance of :c:type:`PyTypeObject` representing the Python

Doc/c-api/tuple.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ Tuple Objects
1919
is the same object as :class:`tuple` in the Python layer.
2020

2121

22-
.. c:var:: PyTypeObject PyTupleIter_Type
23-
24-
Type object for an iterator over a :class:`tuple` object. Instances
25-
of this object are returned by :meth:`!tuple.__iter__`.
26-
27-
2822
.. c:function:: int PyTuple_Check(PyObject *p)
2923
3024
Return true if *p* is a tuple object or an instance of a subtype of the

0 commit comments

Comments
 (0)