Hacker News new | ask | show | jobs
by thayne 931 days 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.