-
Notifications
You must be signed in to change notification settings - Fork 9
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
Remove object.__setattr__ frozen bypasses #170
Comments
One thought: what if we had a (meta? sub?) class that behaved like the normal frozen dataclass, but was private, and had a |
yes I like the idea of having an unfrozen ('molten'?) state version for mocking to manipulate during charm execution, and then return its frozen version back to the userspace when we're done. |
Moved to canonical/operator#1423 |
I think we're all agreed that it would be nice if we didn't have to have a bunch of
object.__setattr__(self, "attribute", new_value)
in the state (while still keeping the immutability that the frozen dataclasses provide).A few of these are in
__post_init__
and probably need to stay as they are. The majority are handling components of the state being changed during the event - new secret content, opening/closing ports, setting the unit/app status, etc. It would be nice to keep the immutability but avoid theobject.__setattr__
for those.The text was updated successfully, but these errors were encountered: