If you don’t want anybody to adjust the attributes of a class, use @dataclass(frozen=True).
@dataclass(frozen=True)
In the example above, changing the attribute color of the DataClassDog‘s instance will throw an error.
DataClassDog
Python-Magic: Reliable File Type Detection Beyond Extensions
Simplify Nested Structures with Python Data Classes
Hydra: YAML-Based Config Management Made Simple
Your email address will not be published. Required fields are marked *
Name
Email
Website
Save my name, email, and website in this browser for the next time I comment.
Δ