Comment on Don't let dicts spoil your code (2020)Comments−leetrout4yYes to the principle. But typed dict is useful for more than just "the wire".There are places where you just dont need the overhead of a class. Yes slotted classes make this much cheaper but so do named tuples.If the behavior of a thing is to map values then it should stay a dict.If the behavior is a bag of attributes then yes pick something better.
Comments
Yes to the principle. But typed dict is useful for more than just "the wire".
There are places where you just dont need the overhead of a class. Yes slotted classes make this much cheaper but so do named tuples.
If the behavior of a thing is to map values then it should stay a dict.
If the behavior is a bag of attributes then yes pick something better.