Skip to content

Forbid .pop of Readonly NotRequired TypedDict items#19133

Merged
JelleZijlstra merged 1 commit into
python:masterfrom
sterliakov:bugfix/gh-19130-readonly-key-pop
May 23, 2025
Merged

Forbid .pop of Readonly NotRequired TypedDict items#19133
JelleZijlstra merged 1 commit into
python:masterfrom
sterliakov:bugfix/gh-19130-readonly-key-pop

Conversation

@sterliakov

Copy link
Copy Markdown
Collaborator

Fixes #19130. We already have these checks for del typed_dict["readonly_notrequired_key"], this just aligns .pop() logic with that.

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@JelleZijlstra JelleZijlstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JelleZijlstra
JelleZijlstra merged commit a8ec893 into python:master May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False negative: popping a ReadOnly key from a TypedDict

2 participants