In CPython, calling super() has about the same cost as calling any other builtin like len() or int(). The MRO itself is precomputed and stored in inst.__class__.__mro__.
Contrasting dict.__setitem__ with super().__setitem__, the latter adds one function call. In addition, both forms require a builtin lookup and an attribute lookup.
In PyPy, much of the overhead of builtin lookups, function calls, and attribute lookups is automatically optimized away.
Contrasting dict.__setitem__ with super().__setitem__, the latter adds one function call. In addition, both forms require a builtin lookup and an attribute lookup.
In PyPy, much of the overhead of builtin lookups, function calls, and attribute lookups is automatically optimized away.