Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call __post_init__ when converting struct from object #752

Merged
merged 1 commit into from
Oct 20, 2024

Conversation

jcrist
Copy link
Owner

@jcrist jcrist commented Oct 20, 2024

Previously a struct's __post_init__ method wouldn't be called when converting from a custom mapping or object with from_attributes=True. This PR fixes that and expands the tests to cover this case.

Fixes #673.

Previously a struct's `__post_init__` method wouldn't be called when
converting from a custom mapping or object with `from_attributes=True`.
This PR fixes that and expands the tests to cover this case.
@jcrist jcrist merged commit 150f64a into main Oct 20, 2024
7 checks passed
@jcrist jcrist deleted the call-post-init-convert-struct-from-attributes branch October 20, 2024 18:22
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.

Struct __post_init__ is not called when converting to Struct with from_attributes=True
1 participant