summaryrefslogtreecommitdiff
path: root/Doc/c-api/object.rst
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2012-10-06 14:03:24 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2012-10-06 14:03:24 +0200
commitb88a8dfe8dec8b24ce278c645ceb2cc901462cf8 (patch)
treed18a726eed60ab945c3f38ac9ba2990870a15b4c /Doc/c-api/object.rst
parent9a6ec11c5bce87f27559debad03bcd6a7885e591 (diff)
downloadcpython-b88a8dfe8dec8b24ce278c645ceb2cc901462cf8.tar.gz
Issue #16148: implemented PEP 424
Diffstat (limited to 'Doc/c-api/object.rst')
-rw-r--r--Doc/c-api/object.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
index d895547f1f..8458fe88cf 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -342,6 +342,13 @@ is considered sufficient for this determination.
returned. This is the equivalent to the Python expression ``len(o)``.
+.. c:function:: Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t default)
+
+ Return an estimated length for the object *o*. First trying to return its
+ actual length, then an estimate using ``__length_hint__``, and finally
+ returning the default value. On error ``-1`` is returned. This is the
+ equivalent to the Python expression ``operator.length_hint(o, default)``.
+
.. c:function:: PyObject* PyObject_GetItem(PyObject *o, PyObject *key)
Return element of *o* corresponding to the object *key* or *NULL* on failure.