diff options
author | Victor Stinner <vstinner@python.org> | 2023-08-24 20:01:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-24 20:01:50 (GMT) |
commit | 26893016a7f204b2e7138fc9ce04525a651c202e (patch) | |
tree | 994751eab58657e125b23a426fb5441612ec5ad2 /Modules/_testcapimodule.c | |
parent | c3d580b238fb1b5a72d5608ff7905e9ad726d1bb (diff) | |
download | cpython-26893016a7f204b2e7138fc9ce04525a651c202e.zip cpython-26893016a7f204b2e7138fc9ce04525a651c202e.tar.gz cpython-26893016a7f204b2e7138fc9ce04525a651c202e.tar.bz2 |
gh-106320: Remove private _PyDict functions (#108449)
Move private functions to the internal C API (pycore_dict.h):
* _PyDictView_Intersect()
* _PyDictView_New()
* _PyDict_ContainsId()
* _PyDict_DelItemId()
* _PyDict_DelItem_KnownHash()
* _PyDict_GetItemIdWithError()
* _PyDict_GetItem_KnownHash()
* _PyDict_HasSplitTable()
* _PyDict_NewPresized()
* _PyDict_Next()
* _PyDict_Pop()
* _PyDict_SetItemId()
* _PyDict_SetItem_KnownHash()
* _PyDict_SizeOf()
No longer export most of these functions.
Move also the _PyDictViewObject structure to the internal C API.
Move dict_getitem_knownhash() function from _testcapi to the
_testinternalcapi extension. Update test_capi.test_dict for this
change.
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r-- | Modules/_testcapimodule.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 6a1eba3..20b9632 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -271,26 +271,6 @@ test_dict_iteration(PyObject* self, PyObject *Py_UNUSED(ignored)) Py_RETURN_NONE; } -static PyObject* -dict_getitem_knownhash(PyObject *self, PyObject *args) -{ - PyObject *mp, *key, *result; - Py_ssize_t hash; - - if (!PyArg_ParseTuple(args, "OOn:dict_getitem_knownhash", - &mp, &key, &hash)) { - return NULL; - } - - result = _PyDict_GetItem_KnownHash(mp, key, (Py_hash_t)hash); - if (result == NULL && !PyErr_Occurred()) { - _PyErr_SetKeyError(key); - return NULL; - } - - return Py_XNewRef(result); -} - /* Issue #4701: Check that PyObject_Hash implicitly calls * PyType_Ready if it hasn't already been called */ @@ -3353,7 +3333,6 @@ static PyMethodDef TestMethods[] = { {"test_sizeof_c_types", test_sizeof_c_types, METH_NOARGS}, {"test_list_api", test_list_api, METH_NOARGS}, {"test_dict_iteration", test_dict_iteration, METH_NOARGS}, - {"dict_getitem_knownhash", dict_getitem_knownhash, METH_VARARGS}, {"test_lazy_hash_inheritance", test_lazy_hash_inheritance,METH_NOARGS}, {"test_xincref_doesnt_leak",test_xincref_doesnt_leak, METH_NOARGS}, {"test_incref_doesnt_leak", test_incref_doesnt_leak, METH_NOARGS}, |