|
|
|
|
|
by rmbyrro
1565 days ago
|
|
> Don't use classes for information. Use regular data structures (dict, list, tuple, set) and use functions to manipulate them. One problem is many of these datastructures are easy to mutate. When I need to ensure immutability to a dictionary, for instance - quite often - I can't avoid wrapping it in a class and setting up an interface to lock down mutation. If Python had a way to declare immutable datastructure, similarly to Clojure, it would make life a lot easier... |
|