]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-132617: Fix `dict.update()` mutation check (gh-134815)
authorSam Gross <colesbury@gmail.com>
Mon, 16 Jun 2025 16:55:20 +0000 (12:55 -0400)
committerGitHub <noreply@github.com>
Mon, 16 Jun 2025 16:55:20 +0000 (12:55 -0400)
commitd8994b0a77cc9821772d05db00a6ab23382fa17d
tree1e3d0f76db96a70443b47874b9d9324098b77c26
parent4c15505071498439407483004721d0369f110229
gh-132617: Fix `dict.update()` mutation check (gh-134815)

Use `ma_used` instead of `ma_keys->dk_nentries` for modification check
so that we only check if the dictionary is modified, not if new keys are
added to a different dictionary that shared the same keys object.
Lib/test/test_dict.py
Misc/NEWS.d/next/Core_and_Builtins/2025-05-27-20-29-00.gh-issue-132617.EmUfQQ.rst [new file with mode: 0644]
Objects/dictobject.c