Skip to content

Fix Union MRO inheritance causing RecursionError#81

Merged
NiklasRosenstein merged 2 commits intodevelopfrom
fix/union-mro-recursion
Apr 2, 2026
Merged

Fix Union MRO inheritance causing RecursionError#81
NiklasRosenstein merged 2 commits intodevelopfrom
fix/union-mro-recursion

Conversation

@NiklasRosenstein
Copy link
Copy Markdown
Owner

Summary

Test plan

🤖 Generated with Claude Code

NiklasRosenstein and others added 2 commits April 2, 2026 23:50
Add `inheritable` attribute to ClassDecoratorSetting (default True) and
set it to False on Union, so Union settings are not inherited by
subclasses through MRO traversal. This prevents infinite recursion when
serializing/deserializing dataclasses registered as union members.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Use ClassVar for inheritable on both ClassDecoratorSetting and Union to
satisfy mypy. Add unreleased changelog entry for #80.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@NiklasRosenstein NiklasRosenstein merged commit d5d4a8b into develop Apr 2, 2026
13 checks passed
@NiklasRosenstein NiklasRosenstein deleted the fix/union-mro-recursion branch April 2, 2026 21:55
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.

Serialization bug using the Union registry

1 participant