Comment on Don't let dicts spoil your code (2020)parentComments−oivey4yThey don't work in the way you would think for dataclasses or at all for dicts/TypedDicts.See this for dataclasses: https://github.com/python/mypy/issues/5374#issuecomment-8841....−BerislavLopac4yThis is a ridiculous example, because dataclasses and protocols are orthogonal: dataclasses (help) define data structures, while protocols define behaviour.
Comments
They don't work in the way you would think for dataclasses or at all for dicts/TypedDicts.
See this for dataclasses: https://github.com/python/mypy/issues/5374#issuecomment-8841....
This is a ridiculous example, because dataclasses and protocols are orthogonal: dataclasses (help) define data structures, while protocols define behaviour.