bpo-28280: Make PyMapping_Keys(), PyMapping_Values() and PyMapping_Items() always return a list (#3840)

This commit is contained in:
Oren Milman 2017-10-08 11:17:46 +03:00 committed by Serhiy Storchaka
parent f07e2b64df
commit 0ccc0f6c74
6 changed files with 137 additions and 34 deletions

View file

@ -50,20 +50,29 @@ Mapping Protocol
.. c:function:: 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 of the keys in object *o*. On failure, return
*NULL*.
.. versionchanged:: 3.7
Previously, the function returned a list or a tuple.
.. c:function:: 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 of the values in object *o*. On failure, return
*NULL*.
.. versionchanged:: 3.7
Previously, the function returned a list or a tuple.
.. c:function:: 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 of the items in object *o*, where each item is a
tuple containing a key-value pair. On failure, return *NULL*.
.. versionchanged:: 3.7
Previously, the function returned a list or a tuple.
.. c:function:: PyObject* PyMapping_GetItemString(PyObject *o, const char *key)