8000 PEP 699 Implementation · python/cpython@afd678c · GitHub
[go: up one dir, main page]

Skip to content

Commit afd678c

Browse files
committed
PEP 699 Implementation
1 parent 3847a6c commit afd678c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Include/cpython/dictobject.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ typedef struct {
1616

1717
/* Dictionary version: globally unique, value change each time
1818
the dictionary is modified */
19+
#ifdef Py_BUILD_CORE
1920
uint64_t ma_version_tag;
21+
#else
22+
Py_DEPRECATED(3.12) uint64_t ma_values_tag;
23+
#endif
2024

2125
PyDictKeysObject *ma_keys;
2226

Modules/_testcapimodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,7 +2148,10 @@ dict_get_version(PyObject *self, PyObject *args)
21482148
if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
21492149
return NULL;
21502150

2151+
_Py_COMP_DIAG_PUSH
2152+
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
21512153
version = dict->ma_version_tag;
2154+
_Py_COMP_DIAG_POP
21522155

21532156
static_assert(sizeof(unsigned long long) >= sizeof(version),
21542157
"version is larger than unsigned long long");

0 commit comments

Comments
 (0)
0