]> granicus.if.org Git - python/commitdiff
bpo-29084: Exclude C API for OrderedDict from the limited C API. (#4900)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 25 Dec 2017 00:08:42 +0000 (02:08 +0200)
committerGitHub <noreply@github.com>
Mon, 25 Dec 2017 00:08:42 +0000 (02:08 +0200)
Include/odictobject.h
Misc/NEWS.d/next/C API/2017-12-16-09-59-35.bpo-29084.ZGJ-LJ.rst [new file with mode: 0644]

index ff6ad64b8b4e826dc408451b7787550d37b48007..8378dc4bfa45b4c3b573dd274719e09237b9f25d 100644 (file)
@@ -6,6 +6,7 @@ extern "C" {
 
 
 /* OrderedDict */
+/* This API is optional and mostly redundant. */
 
 #ifndef Py_LIMITED_API
 
@@ -21,10 +22,6 @@ PyAPI_DATA(PyTypeObject) PyODictValues_Type;
 #define PyODict_CheckExact(op) (Py_TYPE(op) == &PyODict_Type)
 #define PyODict_SIZE(op) PyDict_GET_SIZE((op))
 
-#endif /* Py_LIMITED_API */
-
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
-
 PyAPI_FUNC(PyObject *) PyODict_New(void);
 PyAPI_FUNC(int) PyODict_SetItem(PyObject *od, PyObject *key, PyObject *item);
 PyAPI_FUNC(int) PyODict_DelItem(PyObject *od, PyObject *key);
diff --git a/Misc/NEWS.d/next/C API/2017-12-16-09-59-35.bpo-29084.ZGJ-LJ.rst b/Misc/NEWS.d/next/C API/2017-12-16-09-59-35.bpo-29084.ZGJ-LJ.rst
new file mode 100644 (file)
index 0000000..940f716
--- /dev/null
@@ -0,0 +1,2 @@
+Undocumented C API for OrderedDict has been excluded from the limited C API.
+It was added by mistake and actually never worked in the limited C API.