gh-128863: Deprecate private C API functions (#128864)

Deprecate private C API functions:

* _PyBytes_Join()
* _PyDict_GetItemStringWithError()
* _PyDict_Pop()
* _PyThreadState_UncheckedGet()
* _PyUnicode_AsString()
* _Py_HashPointer()
* _Py_fopen_obj()

Replace _Py_HashPointer() with Py_HashPointer().

Remove references to deprecated functions.
This commit is contained in:
Victor Stinner 2025-01-22 12:04:19 +01:00 committed by GitHub
parent 470a0a68eb
commit 9012fa741d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 103 additions and 30 deletions

View file

@ -29,9 +29,6 @@
/* Helpers for hash functions */
PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
// Kept for backward compatibility
#define _Py_HashPointer Py_HashPointer
/* hash function definition */
typedef struct {
@ -44,6 +41,14 @@ typedef struct {
PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void);
PyAPI_FUNC(Py_hash_t) Py_HashPointer(const void *ptr);
// Deprecated alias kept for backward compatibility
Py_DEPRECATED(3.14) static inline Py_hash_t
_Py_HashPointer(const void *ptr)
{
return Py_HashPointer(ptr);
}
PyAPI_FUNC(Py_hash_t) PyObject_GenericHash(PyObject *);
PyAPI_FUNC(Py_hash_t) Py_HashBuffer(const void *ptr, Py_ssize_t len);