Skip to content

Fix: Resolve super() error in dataclasses via virtual subclassing#431

Open
Ashutosh0x wants to merge 1 commit intogoogle-deepmind:mainfrom
Ashutosh0x:fix/issue-212
Open

Fix: Resolve super() error in dataclasses via virtual subclassing#431
Ashutosh0x wants to merge 1 commit intogoogle-deepmind:mainfrom
Ashutosh0x:fix/issue-212

Conversation

@Ashutosh0x
Copy link

@Ashutosh0x Ashutosh0x commented Jan 6, 2026

Resolves #212.

Changes chex.dataclass to register as a virtual subclass of collections.abc.Mapping instead of recreating the class via type(). This preserves the __class__ closure, fixing runtime errors when using super() in methods like __post_init__.

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.

post_init error in inherited dataclass

1 participant