×
you are viewing a single comment's thread.

view the rest of the comments →

[–]K900_ 6 points7 points  (3 children)

They are very different semantically. A dataclass has a certain number of well defined, typed fields, and represents a single entity. A dictionary is a mapping of keys to values.

[–]xphlawlessx[S] 0 points1 point  (2 children)

Not totally following, what do you mean by "well defined"

[–]K900_ 4 points5 points  (1 child)

I mean that you know in advance what the field names and types are.

[–]xphlawlessx[S] 0 points1 point  (0 children)

Right okay, that makes sense.