Add a new private version to the builtin dict type
Issue #26058: Add a new private version to the builtin dict type, incremented
at each dictionary creation and at each dictionary change.
Implementation of the PEP 509.
diff --git a/Include/dictobject.h b/Include/dictobject.h
index 02d40ff..19194ed 100644
--- a/Include/dictobject.h
+++ b/Include/dictobject.h
@@ -26,6 +26,10 @@
/* Number of items in the dictionary */
Py_ssize_t ma_used;
+ /* Dictionary version: globally unique, value change each time
+ the dictionary is modified */
+ uint64_t ma_version_tag;
+
PyDictKeysObject *ma_keys;
/* If ma_values is NULL, the table is "combined": keys and values