|
|
|
|
|
by pansa2
611 days ago
|
|
> convert [dicts] immediately to data structures providing semantics [...] You can simplify your work by employing a library that makes “better classes” for you Python seems to have many different kinds of "better classes" - the article mentions `dataclass` and `TypedDict`, and AFAIK there are also two different kinds of named tuple (`collections.namedtuple` and `Typing.NamedTuple`). What are the advantages of these "better classes" over traditional classes? How would you choose which of the four (or more?) kinds to use? |
|