Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-141510: Don't accept frozendict in PyDict_Watch()#145529

Merged
vstinner merged 1 commit into
python:mainpython/cpython:mainfrom
vstinner:dict_watchvstinner/cpython:dict_watchCopy head branch name to clipboard
Mar 5, 2026
Merged

gh-141510: Don't accept frozendict in PyDict_Watch()#145529
vstinner merged 1 commit into
python:mainpython/cpython:mainfrom
vstinner:dict_watchvstinner/cpython:dict_watchCopy head branch name to clipboard

Conversation

@vstinner

@vstinner vstinner commented Mar 5, 2026

Copy link
Copy Markdown
Member

Don't accept frozendict in PyDict_Watch() and PyDict_Unwatch(). A frozendict cannot be modified, so it's not useful to watch for modifications.

Don't accept frozendict in PyDict_Watch() and PyDict_Unwatch(). A
frozendict cannot be modified, so it's not useful to watch for
modifications.
@vstinner

vstinner commented Mar 5, 2026

Copy link
Copy Markdown
Member Author

I don't recall why I modified PyDict_Watch() and PyDict_Unwatch() to accept frozendict in my commit 696cdfc. Maybe I just replaced mechanically PyDict_Check() with PyAnyDict_Check().

A frozendict cannot be modified, so it's not useful to watch for modifications.

If later, it becomes useful, we can modify the functions again. But I prefer to start by not accepting them.

@vstinner

vstinner commented Mar 5, 2026

Copy link
Copy Markdown
Member Author

cc @corona10 @Fidget-Spinner

@vstinner vstinner merged commit 0fe20fc into python:main Mar 5, 2026
56 checks passed
@vstinner vstinner deleted the dict_watch branch March 5, 2026 11:31
@vstinner

vstinner commented Mar 5, 2026

Copy link
Copy Markdown
Member Author

Merged. Thanks for the review @Fidget-Spinner.

ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
…5529)

Don't accept frozendict in PyDict_Watch() and PyDict_Unwatch().
A frozendict cannot be modified, so it's not useful to watch for
modifications.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.