Python 3 Deep Dive Part 4 Oop High Quality Here
Most developers know __init__ , but the real constructor is __new__ .
:
When you use multiple inheritance, Python uses the C3 Linearization algorithm to determine which method is called. You can inspect this via __mro__ . python 3 deep dive part 4 oop high quality
: Implementing __eq__ , __lt__ , and others allows your custom objects to be sorted and compared natively. Most developers know __init__ , but the real
: Methods are just functions stored in the class until accessed via an instance, which "binds" them into bound methods. Most developers know __init__