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

Add msgspec.structs.force_setattr #600

Merged
merged 1 commit into from
Dec 4, 2023
Merged

Add msgspec.structs.force_setattr #600

merged 1 commit into from
Dec 4, 2023

Conversation

jcrist
Copy link
Owner

@jcrist jcrist commented Dec 4, 2023

This is an advanced (and potentially unsafe) function that allows for mutating a frozen struct. The primary use case for this is mutating the struct in a __post_init__ method before returning. Most users shouldn't ever use this.

Fixes #588.

This is an advanced (and potentially unsafe) function that allows for
mutating a frozen struct. The primary use case for this is mutating the
struct in a `__post_init__` method before returning. Most users
shouldn't ever use this.
@jcrist jcrist merged commit 5593670 into main Dec 4, 2023
7 checks passed
@jcrist jcrist deleted the struct-force-setattr branch December 4, 2023 17:08
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.

Allow use of object.__setattr__ to modify frozen instances of Struct
1 participant