summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2012-10-06 12:03:24 (GMT)
committerArmin Ronacher <armin.ronacher@active-4.com>2012-10-06 12:03:24 (GMT)
commitaa9a79d27958ae5afb6c8769a2b342d98677c091 (patch)
tree24d49f530111a345c57f053a7f40652fa51d27a3 /Doc/c-api
parentef08fb1f040cb51e752c6b1322008714262fbf3e (diff)
downloadcpython-aa9a79d27958ae5afb6c8769a2b342d98677c091.zip
cpython-aa9a79d27958ae5afb6c8769a2b342d98677c091.tar.gz
cpython-aa9a79d27958ae5afb6c8769a2b342d98677c091.tar.bz2
Issue #16148: implemented PEP 424
Diffstat (limited to 'Doc/c-api')
-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 d895547..8458fe8 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.