summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/float.rst
diff options
context:
space:
mode:
authorF3eQnxN3RriK <drsuaimqjgar@gmail.com>2023-06-30 14:27:09 (GMT)
committerGitHub <noreply@github.com>2023-06-30 14:27:09 (GMT)
commita8ae73965b02302b7661ea07a6e4f955a961aca9 (patch)
tree3cd29e9df9c453e7ba1fa4644243fdd35dc3e053 /Doc/c-api/float.rst
parent319de0b578ec3dec8d30610caee3aa93f51060c7 (diff)
downloadcpython-a8ae73965b02302b7661ea07a6e4f955a961aca9.zip
cpython-a8ae73965b02302b7661ea07a6e4f955a961aca9.tar.gz
cpython-a8ae73965b02302b7661ea07a6e4f955a961aca9.tar.bz2
gh-101100: Docs: Fix references to several numeric dunders (#106278)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diffstat (limited to 'Doc/c-api/float.rst')
-rw-r--r--Doc/c-api/float.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst
index 0118bea..fd0be11 100644
--- a/Doc/c-api/float.rst
+++ b/Doc/c-api/float.rst
@@ -45,14 +45,14 @@ Floating Point Objects
.. c:function:: double PyFloat_AsDouble(PyObject *pyfloat)
Return a C :c:expr:`double` representation of the contents of *pyfloat*. If
- *pyfloat* is not a Python floating point object but has a :meth:`__float__`
+ *pyfloat* is not a Python floating point object but has a :meth:`~object.__float__`
method, this method will first be called to convert *pyfloat* into a float.
- If ``__float__()`` is not defined then it falls back to :meth:`__index__`.
+ If :meth:`!__float__` is not defined then it falls back to :meth:`~object.__index__`.
This method returns ``-1.0`` upon failure, so one should call
:c:func:`PyErr_Occurred` to check for errors.
.. versionchanged:: 3.8
- Use :meth:`__index__` if available.
+ Use :meth:`~object.__index__` if available.
.. c:function:: double PyFloat_AS_DOUBLE(PyObject *pyfloat)