In Module 12 you wrote __repr__, __eq__ and __add__, and saw that Python calls them for you. Here is the whole picture. The Python data model is the set of special methods that the language and the built-in functions call. An operator, a built-in such as len, a for loop and a call are all, underneath, a method call on the object’s type. Understand the model, and you can make your own objects work with every part of the language.
More lessons in Complete Python Programming