Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dce4ae8

Browse files
committed
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.
2 parents 9f78939 + 1538b3d commit dce4ae8

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

Doc/c-api/mapping.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ Mapping Protocol
5050
5151
.. c:function:: PyObject* PyMapping_Keys(PyObject *o)
5252
53-
On success, return a list of the keys in object *o*. On failure, return *NULL*.
54-
This is equivalent to the Python expression ``list(o.keys())``.
53+
On success, return a list, a tuple or a dictionary view in case of a dict,
54+
of the keys in object *o*. On failure, return *NULL*.
5555
5656
5757
.. c:function:: PyObject* PyMapping_Values(PyObject *o)
5858
59-
On success, return a list of the values in object *o*. On failure, return
60-
*NULL*. This is equivalent to the Python expression ``list(o.values())``.
59+
On success, return a list, a tuple or a dictionary view in case of a dict, of
60+
the values in object *o*. On failure, return *NULL*.
6161
6262
6363
.. c:function:: PyObject* PyMapping_Items(PyObject *o)
6464
65-
On success, return a list of the items in object *o*, where each item is a tuple
66-
containing a key-value pair. On failure, return *NULL*. This is equivalent to
67-
the Python expression ``list(o.items())``.
65+
On success, return a list, a tuple or a dictionary view in case of a dict, of
66+
the items in object *o*, where each item is a tuple containing a key-value
67+
pair. On failure, return *NULL*.
6868
6969
7070
.. c:function:: PyObject* PyMapping_GetItemString(PyObject *o, const char *key)

Include/abstract.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,23 +1216,23 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
12161216
PyAPI_FUNC(PyObject *) PyMapping_Keys(PyObject *o);
12171217

12181218
/*
1219-
On success, return a list or tuple of the keys in object o.
1220-
On failure, return NULL.
1219+
On success, return a list, a tuple or a dictionary view in case of a dict,
1220+
of the keys in object o. On failure, return NULL.
12211221
*/
12221222

12231223
PyAPI_FUNC(PyObject *) PyMapping_Values(PyObject *o);
12241224

12251225
/*
1226-
On success, return a list or tuple of the values in object o.
1227-
On failure, return NULL.
1226+
On success, return a list, a tuple or a dictionary view in case of a dict,
1227+
of the values in object o. On failure, return NULL.
12281228
*/
12291229

12301230
PyAPI_FUNC(PyObject *) PyMapping_Items(PyObject *o);
12311231

12321232
/*
1233-
On success, return a list or tuple of the items in object o,
1234-
where each item is a tuple containing a key-value pair.
1235-
On failure, return NULL.
1233+
On success, return a list, a tuple or a dictionary view in case of a dict,
1234+
of the items in object o, where each item is a tuple containing a key-value
1235+
pair. On failure, return NULL.
12361236
12371237
*/
12381238

0 commit comments

Comments
 (0)