Skip to content

Commit 298bb8d

Browse files
vstinnermementum
authored andcommitted
pythongh-106320: Remove _Py_SwappedOp from the C API (python#107036)
Move _Py_SwappedOp to the internal C API (pycore_object.h).
1 parent afad9ba commit 298bb8d

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

Include/cpython/object.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,6 @@ PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
377377
#endif
378378

379379

380-
/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE.
381-
* Defined in object.c.
382-
*/
383-
PyAPI_DATA(int) _Py_SwappedOp[];
384-
385380
PyAPI_FUNC(void)
386381
_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks,
387382
size_t sizeof_block);

Include/internal/pycore_object.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ extern PyObject* _PyCFunctionWithKeywords_TrampolineCall(
442442
PyAPI_DATA(PyTypeObject) _PyNone_Type;
443443
PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type;
444444

445+
/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE. Defined in Objects/object.c. */
446+
PyAPI_DATA(int) _Py_SwappedOp[];
447+
445448
#ifdef __cplusplus
446449
}
447450
#endif

Objects/object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "pycore_floatobject.h" // _PyFloat_DebugMallocStats()
1010
#include "pycore_initconfig.h" // _PyStatus_EXCEPTION()
1111
#include "pycore_namespace.h" // _PyNamespace_Type
12-
#include "pycore_object.h" // _PyType_CheckConsistency(), _Py_FatalRefcountError()
12+
#include "pycore_object.h" // PyAPI_DATA() _Py_SwappedOp definition
1313
#include "pycore_pyerrors.h" // _PyErr_Occurred()
1414
#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
1515
#include "pycore_pystate.h" // _PyThreadState_GET()

0 commit comments

Comments
 (0)