`frozendict` and `MappingProxyType`s as object-level `__dict__` values
Discussions on Python.org
`frozendict` and `MappingProxyType`s as object-level `__dict__` values
Hi everyone. This is another one of those “frozen/freezable object” thoughts. Most user-defined “immutable” objects are made via subclassing and overriding __setattr__ (or the more convenient @dataclasses.dataclass(frozen=True)). This works well when the object as a whole must be read-only throughout most of its lifetime. As a consequence, internal code that does mutate the object (usually via object.__setattr__()) becomes more verbose and harder to maintain. Currently, values of the object-lev...
0 comments
No comments yet.