issue25909 - Correct the documentation of PyMapping_Items, PyMapping_Keys and
authorSenthil Kumaran <senthil@uthcode.com>
Thu, 21 Jan 2016 17:37:28 +0000 (09:37 -0800)
committerSenthil Kumaran <senthil@uthcode.com>
Thu, 21 Jan 2016 17:37:28 +0000 (09:37 -0800)
PyMapping_Values in Include/abstract.h and Doc/c-api/mapping.rst.

Patch contributed by Sonali Gupta.

Doc/c-api/mapping.rst
Include/abstract.h

index e34104708ca68c734336f3fb5ac18b8a79a8171b..fe601b605b13837f1c38ccb8dae4b19037dc6132 100644 (file)
@@ -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)
index 48b29a75b94a62fbf4b67301b82b1c6f055899fa..4ff79f29281fc1d9a4012fe0b49a67d9642ba363 100644 (file)
@@ -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.
 
        */