Vladimir

18%
Flag icon
It’s good that @dataclass rejects class definitions with a list default value in a field. However, be aware that it is a partial solution that only applies to list, dict, and set. Other mutable values used as defaults will not be flagged by @dataclass. It’s up to you to understand the problem and remember to use a default factory to set mutable default values.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview