Vladimir

17%
Flag icon
By default, @dataclass produces mutable classes. But the decorator accepts a keyword argument frozen—shown in Example 5-3. When frozen=True, the class will raise an exception if you try to assign a value to a field after the instance is initialized.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview