FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-141510: Don't accept frozendict in PyDict_Watch() by vstinner · Pull Request #145529 · python/cpython · GitHub

/ cpython Public

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

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:dict_watch
Mar 5, 2026
Merged

gh-141510: Don't accept frozendict in PyDict_Watch()#145529
vstinner merged 1 commit into
python:mainfrom
vstinner:dict_watch

Conversation

vstinner commented Mar 5, 2026
edited by bedevere-app Bot
Loading

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 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 commented Mar 5, 2026

Copy link
Copy Markdown
Member Author

cc @corona10 @Fidget-Spinner

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

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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL