summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2016-01-21 17:37:28 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2016-01-21 17:37:28 (GMT)
commit1538b3d3dfff284c8976f19c5e475b99717bacd8 (patch)
treefc9f1c8f8de2cdc215703575c42826dbfa860d69
parentd99cd333fedbac4dfdd40b4a15f16e50c82bb9da (diff)
downloadcpython-1538b3d3dfff284c8976f19c5e475b99717bacd8.zip
cpython-1538b3d3dfff284c8976f19c5e475b99717bacd8.tar.gz
cpython-1538b3d3dfff284c8976f19c5e475b99717bacd8.tar.bz2
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.
-rw-r--r--Doc/c-api/mapping.rst14
-rw-r--r--Include/abstract.h14
2 files changed, 14 insertions, 14 deletions
diff --git a/Doc/c-api/mapping.rst b/Doc/c-api/mapping.rst
index e341047..fe601b6 100644
--- a/Doc/c-api/mapping.rst
+++ b/Doc/c-api/mapping.rst
@@ -50,21 +50,21 @@ Mapping Protocol
.. c:function:: PyObject* PyMapping_Keys(PyObject *o)
- On success, return a list of the keys in object *o*. On failure, return *NULL*.
- This is equivalent to the Python expression ``list(o.keys())``.
+ On success, return a list, a tuple or a dictionary view in case of a dict,
+ of the keys in object *o*. On failure, return *NULL*.
.. c:function:: PyObject* PyMapping_Values(PyObject *o)
- On success, return a list of the values in object *o*. On failure, return
- *NULL*. This is equivalent to the Python expression ``list(o.values())``.
+ On success, return a list, a tuple or a dictionary view in case of a dict, of
+ the values in object *o*. On failure, return *NULL*.
.. c:function:: PyObject* PyMapping_Items(PyObject *o)
- On success, return a list of the items in object *o*, where each item is a tuple
- containing a key-value pair. On failure, return *NULL*. This is equivalent to
- the Python expression ``list(o.items())``.
+ On success, return a list, a tuple or a dictionary view in case of a dict, of
+ the items in object *o*, where each item is a tuple containing a key-value
+ pair. On failure, return *NULL*.
.. c:function:: PyObject* PyMapping_GetItemString(PyObject *o, const char *key)
diff --git a/Include/abstract.h b/Include/abstract.h
index 48b29a7..4ff79f2 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -1216,23 +1216,23 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
PyAPI_FUNC(PyObject *) PyMapping_Keys(PyObject *o);
/*
- On success, return a list or tuple 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,
+ of the keys in object o. On failure, return NULL.
*/
PyAPI_FUNC(PyObject *) PyMapping_Values(PyObject *o);
/*
- On success, return a list or tuple of the values in object o.
- On failure, return NULL.
+ On success, return a list, a tuple or a dictionary view in case of a dict,
+ of the values in object o. On failure, return NULL.
*/
PyAPI_FUNC(PyObject *) PyMapping_Items(PyObject *o);
/*
- On success, return a list or tuple of the items in object o,
- where each item is a tuple containing a key-value pair.
- On failure, return NULL.
+ On success, return a list, a tuple or a dictionary view in case of a dict,
+ of the items in object o, where each item is a tuple containing a key-value
+ pair. On failure, return NULL.
*/