-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Immutable classes #50
base: main
Are you sure you want to change the base?
Conversation
Thanks for the typing and work there! Should we stick to the stdlib and use dataclasses with frozen=True? My main concern is introducing a dependency on another package |
Hi! There is no converter and validator in `dataclasses` that is why I did it with `attrs`. But I realized there is a way to do it anyway, so I will move it to `dataclasses` to avoid a dependency.
…On 26 September 2024 08:09:20 GMT+01:00, Antoine Bertin ***@***.***> wrote:
Thanks for the typing and work there! Should we stick to the stdlib and use dataclasses with frozen=True? My main concern is introducing a dependency on another package
--
Reply to this email directly or view it on GitHub:
#50 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
I struggled a bit with using It uses only the |
add test_serialize
solve __getattr__ issue with pickle
closes #35
REBASED TO #49
Uses the attrs package to create frozen classes.
The new instances are picklable in an incompatible way (unpickling old classes would not work).
As a bonus, the instances can be unstructured using cattrs.
This is a test PR, maybe it makes more sense to keep the old code and just forbid setting the attributes using properties.