8000 gh-101152: Implement PEP 699 by ramvikrams · Pull Request #101193 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-101152: Implement PEP 699 #101193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
PEP 699 Implementation
  • Loading branch information
ramvikrams committed Jan 20, 2023
commit afd678c9e2b8c8d5abcde1930c38df57c705653a
4 changes: 4 additions & 0 deletions Include/cpython/dictobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ typedef struct {

/* Dictionary version: globally unique, value change each time
the dictionary is modified */
#ifdef Py_BUILD_CORE
uint64_t ma_version_tag;
#else
Py_DEPRECATED(3.12) uint64_t ma_values_tag;
#endif

PyDictKeysObject *ma_keys;

Expand Down
3 changes: 3 additions & 0 deletions Modules/_testcapimodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,10 @@ dict_get_version(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
return NULL;

_Py_COMP_DIAG_PUSH
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
version = dict->ma_version_tag;
_Py_COMP_DIAG_POP

static_assert(sizeof(unsigned long long) >= sizeof(version),
"version is larger than unsigned long long");
Expand Down
0