5 ms·
NamedTuple works great for a lot of cases, but not always. For example, when dealing with attribute defaults for mutable collections. Dataclasses have a `defaul
by vsmhn 5y ago
NamedTuple works great for a lot of cases, but not always. For example, when dealing with attribute defaults for mutable collections.
Dataclasses have a `default_factory` that is used in these occasions.