(original) (raw)

changeset: 100024:739e1b0032c6 parent: 100022:c6fb1651ea2e parent: 100023:e57949f5d0a9 user: Senthil Kumaran senthil@uthcode.com date: Thu Jan 21 09:38:02 2016 -0800 description: merge from 3.5 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. diff -r c6fb1651ea2e -r 739e1b0032c6 Doc/c-api/mapping.rst --- a/Doc/c-api/mapping.rst Thu Jan 21 18:12:29 2016 +0100 +++ b/Doc/c-api/mapping.rst Thu Jan 21 09:38:02 2016 -0800 @@ -50,21 +50,21 @@ .. 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 -r c6fb1651ea2e -r 739e1b0032c6 Include/abstract.h --- a/Include/abstract.h Thu Jan 21 18:12:29 2016 +0100 +++ b/Include/abstract.h Thu Jan 21 09:38:02 2016 -0800 @@ -1216,23 +1216,23 @@ 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. */ /senthil@uthcode.com