Skip to content

ParamsSpecifier: stop leaking instance annotations into the class (fixes red master) - #51

Merged
thorwhalen merged 1 commit into
masterfrom
fix-annotations-leak
Oct 20, 2026
Merged

thorwhalen merged 1 commit into
masterfrom
fix-annotations-leak

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Master went red after #50 (the 3.10 ParamsSpecifier doctest saw y, z params from a test that ran from_func first). Cause is older: __init__ did self.__annotations__.update(...), which mutates the class's own __annotations__ dict once it exists (always on 3.10), so annotations leak across instances. Now each instance gets its own merged dict.

Regression test fails without the fix (on 3.12 too, by forcing the class dict into existence).

🤖 Generated with Claude Code

__init__ updated self.__annotations__ in place, which is the class's dict once
it exists (always, on 3.10), so every instance's annotations leaked into later
ones. Master CI (3.10) failed on the ParamsSpecifier doctest after #50's test
ran from_func on another function first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thorwhalen
thorwhalen merged commit f87b5ce into master Oct 20, 2026
6 checks passed
@thorwhalen
thorwhalen deleted the fix-annotations-leak branch October 20, 2026 18:32
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.

1 participant