mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Issue #16148: implemented PEP 424
This commit is contained in:
parent
ef08fb1f04
commit
aa9a79d279
14 changed files with 161 additions and 82 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue