Mercurial > cpython-lru_cache-weakref
diff Doc/c-api/float.rst @ 74023:68cbf6551710 3.2
Issue #13522: document error return values of some float and complex C API functions.
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Sun, 18 Dec 2011 01:25:27 +0100 |
| parents | 3c9232a684ae |
| children |
line wrap: on
line diff
--- a/Doc/c-api/float.rst Sat Dec 17 23:18:07 2011 +0100 +++ b/Doc/c-api/float.rst Sun Dec 18 01:25:27 2011 +0100 @@ -47,6 +47,8 @@ Return a C :c:type:`double` representation of the contents of *pyfloat*. If *pyfloat* is not a Python floating point object but has a :meth:`__float__` method, this method will first be called to convert *pyfloat* into a float. + This method returns ``-1.0`` upon failure, so one should call + :c:func:`PyErr_Occurred` to check for errors. .. c:function:: double PyFloat_AS_DOUBLE(PyObject *pyfloat)
