When you need to return complex data from a function you typically think of two options:
- put the values in a dictionary
- create a new object/class
The first option is simple to implement but you need to access the individual values by their keys. The second option allows you to access data via attributes and do custom calculations behind the scenes, but then you need to implement yet another class.
Is there something in Python that could give us easy attribute access without having to bother with custom classes?