– PyObject_INIT() and$_{PyObject_INIT_VAR()}$ become regular “opaque” function to hide im- plementation details. • The PyModule_AddType() function is added to help adding a type to a module. (Contributed by Dong-hee Na in bpo-40024.) • Added the functions PyObject_GC_IsTracked() and PyObject_GC_IsFinalized() to the pub- lic API to allow to query if Python objects are being currently tracked or have been already finalized by the garbage collector respectively. (Contributed by Pablo Galindo Salgado in bpo-40241.) • Added _PyObject_FunctionStr() to get a user-friendly string representation of a function-like object. (Patch by Jeroen Demeyer in bpo-37645.) • Added PyObject_CallOneArg() for calling an object with one positional argument (Patch by Jeroen Demeyer in bpo-37483.) • PyInterpreterState.eval_frame ( PEP 523 ) now requires a new mandatory tstate parameter ($_{PyThreadState*}$). (Contributed by Victor Stinner in bpo-38500.) • Extension modules: m_traverse , m_clear and m_free functions of PyModuleDef are no longer called if the module state was requested but is not allocated yet. This is the case immediately after the module is created and before the module is executed ($_{Py_mod_exec}$ function). More precisely, these functions are not called if$_{m_size}$ is greater than 0 and the module state (as returned by$_{PyModule_GetState()}$ ) is NULL . • If$_{Py_AddPendingCall()}$ is called in a subinterpreter, the function is now scheduled to be called from the subinterpreter, rather than being called from the main interpreter. Each subinterpreter now has its own list of scheduled calls. (Contributed by Victor Stinner in bpo-39984.) • The Windows registry is no longer used to initialize$_{sys.path}$when the$_{-E}$ option is used (if$_{PyConfig.}$ use_environment is set to$_{0}$ ). This is significant when embedding Python on Windows. (Contributed by Zackery Spytz in bpo-8901.) • The global variable PyStructSequence_UnnamedField is now a constant and refers to a constant string. (Contributed by Serhiy Storchaka in bpo-38650.) • The$_{PyGC_Head}$ structure is now opaque. It is only defined in the internal C API ($_{pycore_gc.h}$ ). (Con- tributed by Victor Stinner in bpo-40241.) • The Py_UNICODE_COPY , Py_UNICODE_FILL , PyUnicode_WSTR_LENGTH , PyUnicode_FromUnicode() , PyUnicode_AsUnicode() , $_{_PyUnicode_AsUnicode}$, and$_{PyUnicode_AsUnicodeAndSize()}$are marked as deprecated in C. They have been deprecated by PEP 393 since Python 3.3. (Contributed by Inada Naoki in bpo-36346.) • The$_{Py_FatalError()}$ function is replaced with a macro which logs automatically the name of the current function, unless the$_{Py_LIMITED_API}$ macro is defined. (Contributed by Victor Stinner in bpo-39882.) • The vectorcall protocol now requires that the caller passes only strings as keyword names. (See bpo-37540 for more information.) • Implementation details of a number of macros and functions are now hidden: – PyObject_IS_GC() macro was converted to a function. – The PyObject_NEW() macro becomes an alias to the PyObject_New() macro, and the PyObject_NEW_VAR() macro becomes an alias to the$_{PyObject_NewVar()}$ macro. They no longer access directly the$_{PyTypeObject.tp_basicsize}$ member. – PyType_HasFeature() now always calls$_{PyType_GetFlags()}$ . Previously, it accessed directly the$_{PyTypeObject.tp_flags}$ member when the limited C API was not used. 20 12.2 Porting to Python 3.9 (Contributed by Victor Stinner in bpo-38644 and bpo-39542.) Extension modules without module state ($_{m_size <= 0}$ ) are not affected.