Skip to content

Drop runtime error in PEP 705 implementation#333

Merged
srittau merged 1 commit intopython:mainfrom
JelleZijlstra:permissive705
Feb 14, 2024
Merged

Drop runtime error in PEP 705 implementation#333
srittau merged 1 commit intopython:mainfrom
JelleZijlstra:permissive705

Conversation

@JelleZijlstra
Copy link
Copy Markdown
Member

@srittau srittau merged commit d6c50f5 into python:main Feb 14, 2024
@JelleZijlstra JelleZijlstra deleted the permissive705 branch February 14, 2024 16:55
@@ -1,5 +1,8 @@
# Unreleased

- Drop runtime error when a mutable `TypedDict` key overrides a read-only
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment is back to front I think @JelleZijlstra ? May be confusing

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You're right, thanks

else:
optional_keys.add(annotation_key)
if ReadOnly in qualifiers:
if annotation_key in mutable_keys:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you not want to replace this with a mutable_keys.discard? I think that would be symmetric with how this code handles other "illegal" overrides, e.g. with Required.

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.

3 participants