Issue #16148: implemented PEP 424

This commit is contained in:
Armin Ronacher 2012-10-06 14:03:24 +02:00
parent ef08fb1f04
commit aa9a79d279
14 changed files with 161 additions and 82 deletions

View file

@ -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.