]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Move _PyNone_Type to the internal C API (#107030)
authorVictor Stinner <vstinner@python.org>
Sat, 22 Jul 2023 14:12:17 +0000 (16:12 +0200)
committerGitHub <noreply@github.com>
Sat, 22 Jul 2023 14:12:17 +0000 (14:12 +0000)
Move private types _PyNone_Type and _PyNotImplemented_Type to
internal C API.

Include/cpython/object.h
Include/internal/pycore_object.h
Modules/_pickle.c

index cd421b4f7e0d4997775c1699c75588900bfd9b45..0e5b6acb43b41617d102c7dececf652edb0947f5 100644 (file)
@@ -377,9 +377,6 @@ PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
 #endif
 
 
-PyAPI_DATA(PyTypeObject) _PyNone_Type;
-PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type;
-
 /* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE.
  * Defined in object.c.
  */
index 2358f48738a905de8974361619e25548c7430de4..90588daa64cc3beaba237446916abbbdc99cc5e2 100644 (file)
@@ -438,6 +438,10 @@ extern PyObject* _PyCFunctionWithKeywords_TrampolineCall(
     (meth)((self), (args), (kw))
 #endif // __EMSCRIPTEN__ && PY_CALL_TRAMPOLINE
 
+// _pickle shared extension uses _PyNone_Type and _PyNotImplemented_Type
+PyAPI_DATA(PyTypeObject) _PyNone_Type;
+PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type;
+
 #ifdef __cplusplus
 }
 #endif
index ea44b494cdd7cd87adcc56ef4be2c238a4f8ece4..f2e98c10ef71882e82dcca8d10eaac71169df10f 100644 (file)
@@ -12,6 +12,7 @@
 #include "pycore_bytesobject.h"   // _PyBytesWriter
 #include "pycore_ceval.h"         // _Py_EnterRecursiveCall()
 #include "pycore_moduleobject.h"  // _PyModule_GetState()
+#include "pycore_object.h"        // _PyNone_Type
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_runtime.h"       // _Py_ID()
 #include "structmember.h"         // PyMemberDef