– $_{PyObject_GET_WEAKREFS_LISTPTR()}$macro was converted to a function: the macro accessed directly the PyTypeObject.tp_weaklistoffset member. 

– PyObject_CheckBuffer() macro was converted to a function: the macro accessed directly the PyTypeObject.tp_as_buffer member. 

– PyIndex_Check() is now always declared as an opaque function to hide implementation details: removed the PyIndex_Check() macro. The macro accessed directly the PyTypeObject. tp_as_number member. 

(See bpo-40170 for more details.) 

## 12.3 Removed 

• Excluded $_{PyFPE_START_PROTECT()}$and PyFPE_END_PROTECT() macros of $_{pyfpe.h}$from the limited C API. (Contributed by Victor Stinner in bpo-38835.) 

• The tp_print slot of PyTypeObject has been removed. It was used for printing objects to files in Python 2.7 and before. Since Python 3.0, it has been ignored and unused. (Contributed by Jeroen Demeyer in bpo-36974.) 

• Changes in the limited C API (if$_{Py_LIMITED_API}$ macro is defined): 

– Excluded the following functions from the limited C API: 

∗ PyThreadState_DeleteCurrent() (Contributed by Joannah Nanjekye in bpo-37878.) 

– Moved following functions and definitions to the internal C API: 

(Contributed by Victor Stinner in bpo-38644 and bpo-39542.) 

∗ _Py_CheckRecursionLimit 

∗ _Py_NewReference() 

∗ _Py_ForgetReference() 

∗ _PyTraceMalloc_NewReference() 

∗ _Py_GetRefTotal() 

∗ The trashcan mechanism which never worked in the limited C API. 

∗ PyTrash_UNWIND_LEVEL 

∗ Py_TRASHCAN_BEGIN_CONDITION 

∗ Py_TRASHCAN_BEGIN 

∗ Py_TRASHCAN_END 

∗ Py_TRASHCAN_SAFE_BEGIN 

∗ Py_TRASHCAN_SAFE_END 

∗ _PyDebug_PrintTotalRefs() 

∗ _Py_PrintReferences() 

∗ _Py_PrintReferenceAddresses() 

∗ _Py_tracemalloc_config 

∗ _Py_AddToAllObjects() (specific to$_{Py_TRACE_REFS}$ build) 

• Removed _PyRuntime.getframe hook and removed _PyThreadState_GetFrame macro which was an alias to$_{_PyRuntime.getframe}$ . They were only exposed by the internal C API. Removed also PyThreadFrameGetter type. (Contributed by Victor Stinner in bpo-39946.) 

• Removed the following functions from the C API. Call$_{PyGC_Collect()}$ explicitly to clear all free lists. (Contributed by Inada Naoki and Victor Stinner in bpo-37340, bpo-38896 and bpo-40428.) 

– PyAsyncGen_ClearFreeLists() 

