mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
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:
parent
470a0a68eb
commit
9012fa741d
16 changed files with 103 additions and 30 deletions
|
|
@ -3090,8 +3090,8 @@ PyDict_PopString(PyObject *op, const char *key, PyObject **result)
|
|||
}
|
||||
|
||||
|
||||
PyObject *
|
||||
_PyDict_Pop(PyObject *dict, PyObject *key, PyObject *default_value)
|
||||
static PyObject *
|
||||
dict_pop_default(PyObject *dict, PyObject *key, PyObject *default_value)
|
||||
{
|
||||
PyObject *result;
|
||||
if (PyDict_Pop(dict, key, &result) == 0) {
|
||||
|
|
@ -3104,6 +3104,12 @@ _PyDict_Pop(PyObject *dict, PyObject *key, PyObject *default_value)
|
|||
return result;
|
||||
}
|
||||
|
||||
PyObject *
|
||||
_PyDict_Pop(PyObject *dict, PyObject *key, PyObject *default_value)
|
||||
{
|
||||
return dict_pop_default(dict, key, default_value);
|
||||
}
|
||||
|
||||
static PyDictObject *
|
||||
dict_dict_fromkeys(PyInterpreterState *interp, PyDictObject *mp,
|
||||
PyObject *iterable, PyObject *value)
|
||||
|
|
@ -4465,7 +4471,7 @@ static PyObject *
|
|||
dict_pop_impl(PyDictObject *self, PyObject *key, PyObject *default_value)
|
||||
/*[clinic end generated code: output=3abb47b89f24c21c input=e221baa01044c44c]*/
|
||||
{
|
||||
return _PyDict_Pop((PyObject*)self, key, default_value);
|
||||
return dict_pop_default((PyObject*)self, key, default_value);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue