Skip to content

gh-132285: Fix that __annotate__ is not deleted when __annotations__ is deleted#132286

Merged
JelleZijlstra merged 3 commits into
python:mainfrom
sobolevn:issue-132285
Apr 9, 2025
Merged

gh-132285: Fix that __annotate__ is not deleted when __annotations__ is deleted#132286
JelleZijlstra merged 3 commits into
python:mainfrom
sobolevn:issue-132285

Conversation

@sobolevn

@sobolevn sobolevn commented Apr 8, 2025

Copy link
Copy Markdown
Member

@sobolevn sobolevn requested a review from JelleZijlstra as a code owner April 8, 2025 18:24
@bedevere-app bedevere-app Bot added awaiting core review tests Tests in the Lib/test dir labels Apr 8, 2025
@sobolevn sobolevn force-pushed the issue-132285 branch 2 times, most recently from 13bb12e to 8e65065 Compare April 8, 2025 20:19
@JelleZijlstra

Copy link
Copy Markdown
Member

I think this actually behaves incorrectly. In https://peps.python.org/pep-0749/#effect-of-deleting-annotations we said that deleting __annotations__ should also delete __annotate__. type_set_annotations() tries to do that but it's buggy; do you want to fix it?

@sobolevn

sobolevn commented Apr 9, 2025

Copy link
Copy Markdown
Member Author

Yes, sure :)
Checking type_set_annotations

@sobolevn sobolevn changed the title gh-132285: Add a test when __annotations__ is deleted gh-132285: Fix that __annotate__ is not deleted when __annotations__ is deleted Apr 9, 2025
@sobolevn sobolevn removed the skip news label Apr 9, 2025
@sobolevn sobolevn requested a review from markshannon as a code owner April 9, 2025 09:37
Comment thread Lib/test/test_annotationlib.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants