3 ms·
It's a little more complicated than that if you want to forward some, but not all methods to the delegated object, or have multiple objects you want to delegate
by thayne 3y ago
It's a little more complicated than that if you want to forward some, but not all methods to the delegated object, or have multiple objects you want to delegate to. If you just have __getattr__ delegate everything to one other objects, there isn't much benefit over inheritance.