mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
gh-101100: Fix some broken sphinx references (#107095)
This commit is contained in:
parent
dcd7acb04a
commit
f5147c0cfb
12 changed files with 27 additions and 34 deletions
|
|
@ -6,7 +6,7 @@ Iterator Objects
|
|||
----------------
|
||||
|
||||
Python provides two general-purpose iterator objects. The first, a sequence
|
||||
iterator, works with an arbitrary sequence supporting the :meth:`__getitem__`
|
||||
iterator, works with an arbitrary sequence supporting the :meth:`~object.__getitem__`
|
||||
method. The second works with a callable object and a sentinel value, calling
|
||||
the callable for each item in the sequence, and ending the iteration when the
|
||||
sentinel value is returned.
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
|
|||
|
||||
Return ``1`` if the object provides the mapping protocol or supports slicing,
|
||||
and ``0`` otherwise. Note that it returns ``1`` for Python classes with
|
||||
a :meth:`__getitem__` method, since in general it is impossible to
|
||||
a :meth:`~object.__getitem__` method, since in general it is impossible to
|
||||
determine what type of keys the class supports. This function always succeeds.
|
||||
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
|
|||
This is equivalent to the Python expression ``key in o``.
|
||||
This function always succeeds.
|
||||
|
||||
Note that exceptions which occur while calling the :meth:`__getitem__`
|
||||
Note that exceptions which occur while calling the :meth:`~object.__getitem__`
|
||||
method will get suppressed.
|
||||
To get error reporting use :c:func:`PyObject_GetItem()` instead.
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
|
|||
This is equivalent to the Python expression ``key in o``.
|
||||
This function always succeeds.
|
||||
|
||||
Note that exceptions which occur while calling the :meth:`__getitem__`
|
||||
Note that exceptions which occur while calling the :meth:`~object.__getitem__`
|
||||
method and creating a temporary string object will get suppressed.
|
||||
To get error reporting use :c:func:`PyMapping_GetItemString()` instead.
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ of Python objects.
|
|||
.. warning::
|
||||
|
||||
The deallocation function can cause arbitrary Python code to be invoked (e.g.
|
||||
when a class instance with a :meth:`__del__` method is deallocated). While
|
||||
when a class instance with a :meth:`~object.__del__` method is deallocated). While
|
||||
exceptions in such code are not propagated, the executed code has free access to
|
||||
all Python global variables. This means that any object that is reachable from
|
||||
a global variable should be in a consistent state before :c:func:`Py_DECREF` is
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ Sequence Protocol
|
|||
.. c:function:: int PySequence_Check(PyObject *o)
|
||||
|
||||
Return ``1`` if the object provides the sequence protocol, and ``0`` otherwise.
|
||||
Note that it returns ``1`` for Python classes with a :meth:`__getitem__`
|
||||
Note that it returns ``1`` for Python classes with a :meth:`~object.__getitem__`
|
||||
method, unless they are :class:`dict` subclasses, since in general it
|
||||
is impossible to determine what type of keys the class supports. This
|
||||
function always succeeds.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue