Kaydet (Commit) 1538b3d3 authored tarafından Senthil Kumaran's avatar Senthil Kumaran

issue25909 - Correct the documentation of PyMapping_Items, PyMapping_Keys and

PyMapping_Values in Include/abstract.h and Doc/c-api/mapping.rst.

Patch contributed by Sonali Gupta.
üst d99cd333
...@@ -50,21 +50,21 @@ Mapping Protocol ...@@ -50,21 +50,21 @@ Mapping Protocol
.. c:function:: PyObject* PyMapping_Keys(PyObject *o) .. c:function:: PyObject* PyMapping_Keys(PyObject *o)
On success, return a list of the keys in object *o*. On failure, return *NULL*. On success, return a list, a tuple or a dictionary view in case of a dict,
This is equivalent to the Python expression ``list(o.keys())``. of the keys in object *o*. On failure, return *NULL*.
.. c:function:: PyObject* PyMapping_Values(PyObject *o) .. c:function:: PyObject* PyMapping_Values(PyObject *o)
On success, return a list of the values in object *o*. On failure, return On success, return a list, a tuple or a dictionary view in case of a dict, of
*NULL*. This is equivalent to the Python expression ``list(o.values())``. the values in object *o*. On failure, return *NULL*.
.. c:function:: PyObject* PyMapping_Items(PyObject *o) .. c:function:: PyObject* PyMapping_Items(PyObject *o)
On success, return a list of the items in object *o*, where each item is a tuple On success, return a list, a tuple or a dictionary view in case of a dict, of
containing a key-value pair. On failure, return *NULL*. This is equivalent to the items in object *o*, where each item is a tuple containing a key-value
the Python expression ``list(o.items())``. pair. On failure, return *NULL*.
.. c:function:: PyObject* PyMapping_GetItemString(PyObject *o, const char *key) .. c:function:: PyObject* PyMapping_GetItemString(PyObject *o, const char *key)
......
...@@ -1216,23 +1216,23 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ ...@@ -1216,23 +1216,23 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
PyAPI_FUNC(PyObject *) PyMapping_Keys(PyObject *o); PyAPI_FUNC(PyObject *) PyMapping_Keys(PyObject *o);
/* /*
On success, return a list or tuple of the keys in object o. On success, return a list, a tuple or a dictionary view in case of a dict,
On failure, return NULL. of the keys in object o. On failure, return NULL.
*/ */
PyAPI_FUNC(PyObject *) PyMapping_Values(PyObject *o); PyAPI_FUNC(PyObject *) PyMapping_Values(PyObject *o);
/* /*
On success, return a list or tuple of the values in object o. On success, return a list, a tuple or a dictionary view in case of a dict,
On failure, return NULL. of the values in object o. On failure, return NULL.
*/ */
PyAPI_FUNC(PyObject *) PyMapping_Items(PyObject *o); PyAPI_FUNC(PyObject *) PyMapping_Items(PyObject *o);
/* /*
On success, return a list or tuple of the items in object o, On success, return a list, a tuple or a dictionary view in case of a dict,
where each item is a tuple containing a key-value pair. of the items in object o, where each item is a tuple containing a key-value
On failure, return NULL. pair. On failure, return NULL.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment