Repository navigation
ParamsSpecifier: stop leaking instance annotations into the class (fixes red master) - #51
Merged
Merged
Conversation
__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]>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Master went red after #50 (the 3.10 ParamsSpecifier doctest saw
y,zparams from a test that ranfrom_funcfirst). Cause is older:__init__didself.__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