bpo-28280: Make PyMapping_Keys(), PyMapping_Values() and PyMapping_Items() always return a list (#3840)
diff --git a/Doc/c-api/mapping.rst b/Doc/c-api/mapping.rst
index a71e942..308a976 100644
--- a/Doc/c-api/mapping.rst
+++ b/Doc/c-api/mapping.rst
@@ -50,20 +50,29 @@
.. 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)
diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst
index ecdd2fe..24a1dc4 100644
--- a/Doc/whatsnew/3.7.rst
+++ b/Doc/whatsnew/3.7.rst
@@ -404,6 +404,10 @@
is now of type ``const char *`` rather of ``char *``. (Contributed by Serhiy
Storchaka in :issue:`28769`.)
+* The result of :c:func:`PyMapping_Keys`, :c:func:`PyMapping_Values` and
+ :c:func:`PyMapping_Items` is now always a list, rather than a list or a
+ tuple. (Contributed by Oren Milman in :issue:`28280`.)
+
* Added functions :c:func:`PySlice_Unpack` and :c:func:`PySlice_AdjustIndices`.
(Contributed by Serhiy Storchaka in :issue:`27867`.)