Remoção pendente no Python 3.15¶
The
PyImport_ImportModuleNoBlock(): UsePyImport_ImportModule()instead.PyWeakref_GetObject()andPyWeakref_GET_OBJECT(): UsePyWeakref_GetRef()instead. The pythoncapi-compat project can be used to getPyWeakref_GetRef()on Python 3.12 and older.PyUnicode_AsDecodedObject(): usePyCodec_Decode().PyUnicode_AsDecodedUnicode(): UsePyCodec_Decode(); Note que alguns codecs (por exemplo, “base64”) podem retornar um tipo diferente destr, tal comobytes.PyUnicode_AsEncodedObject(): usePyCodec_Encode().PyUnicode_AsEncodedUnicode(): UsePyCodec_Encode(); Note que alguns codecs (por exemplo, “base64”) podem retornar um tipo diferente debytes, tal comstr.Funções de inicialização do Python, descontinuadas no Python 3.9:
Py_GetPath(): UsePyConfig_Get("module_search_paths")(sys.path) instead.Py_GetPrefix(): UsePyConfig_Get("base_prefix")(sys.base_prefix) instead. UsePyConfig_Get("prefix")(sys.prefix) if virtual environments need to be handled.Py_GetExecPrefix(): UsePyConfig_Get("base_exec_prefix")(sys.base_exec_prefix) instead. UsePyConfig_Get("exec_prefix")(sys.exec_prefix) if virtual environments need to be handled.Py_GetProgramFullPath(): UsePyConfig_Get("executable")(sys.executable) instead.Py_GetProgramName(): UsePyConfig_Get("executable")(sys.executable) instead.Py_GetPythonHome(): UsePyConfig_Get("home")or thePYTHONHOMEenvironment variable instead.
O projeto pythoncapi-compat pode ser usado para obter
PyConfig_Get()no Python 3.13 e versões anteriores.