Mar-02-2021, 07:51 AM
I think all 3 are pretty easy to write and for a caller to use. Personally, I prefer named tuples or classes over dicts because they allow you to name the structure itself (as opposed to just the fields). That's clearly good for documentation, too. I don't know whether named tuples already implement
__eq__
and __hash__
should you need them.