summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-07-24 14:02:03 (GMT)
committerGitHub <noreply@github.com>2023-07-24 14:02:03 (GMT)
commitfd66baf34a73871c651326a41886240bf6f986d7 (patch)
treec59b1d1e1987f1c1b0c4e0a2831deebf0eab0870 /Include/internal
parent0a9b339363a59be1249189c767ed6f46fd71e1c7 (diff)
downloadcpython-fd66baf34a73871c651326a41886240bf6f986d7.zip
cpython-fd66baf34a73871c651326a41886240bf6f986d7.tar.gz
cpython-fd66baf34a73871c651326a41886240bf6f986d7.tar.bz2
gh-106320: Remove private _PyDict C API (#107145)
Move private _PyDict functions to the internal C API (pycore_dict.h): * _PyDict_Contains_KnownHash() * _PyDict_DebugMallocStats() * _PyDict_DelItemIf() * _PyDict_GetItemWithError() * _PyDict_HasOnlyStringKeys() * _PyDict_MaybeUntrack() * _PyDict_MergeEx() No longer export these functions.
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pycore_dict.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/Include/internal/pycore_dict.h b/Include/internal/pycore_dict.h
index 6253e08..26a9134 100644
--- a/Include/internal/pycore_dict.h
+++ b/Include/internal/pycore_dict.h
@@ -12,6 +12,26 @@ extern "C" {
#include "pycore_dict_state.h"
#include "pycore_runtime.h" // _PyRuntime
+// Unsafe flavor of PyDict_GetItemWithError(): no error checking
+extern PyObject* _PyDict_GetItemWithError(PyObject *dp, PyObject *key);
+
+extern int _PyDict_Contains_KnownHash(PyObject *, PyObject *, Py_hash_t);
+
+extern int _PyDict_DelItemIf(PyObject *mp, PyObject *key,
+ int (*predicate)(PyObject *value));
+
+extern int _PyDict_HasOnlyStringKeys(PyObject *mp);
+
+extern void _PyDict_MaybeUntrack(PyObject *mp);
+
+/* Like PyDict_Merge, but override can be 0, 1 or 2. If override is 0,
+ the first occurrence of a key wins, if override is 1, the last occurrence
+ of a key wins, if override is 2, a KeyError with conflicting key as
+ argument is raised.
+*/
+extern int _PyDict_MergeEx(PyObject *mp, PyObject *other, int override);
+
+extern void _PyDict_DebugMallocStats(FILE *out);
/* runtime lifecycle */