
On 16/04/22 11:13 pm, Steven D'Aprano wrote:
So we might say that all inheritance is delegation, but not all delegation is inheritance. We might even go further and say that any delegation to a superclass (not just the direct parent) is a form of manual inheritance.
To my way of thinking, delegation is when you call a method of a *different* object. With a super call (either explicit or implicit) you're calling a different method of the *same* object. Think about the ordinary meaning of the word "delegation". When you delegate a task, you give it to someone *else* to do. If instead you just find a different way of doing it yourself, you wouldn't call that delegation. So I would say that none of the things we're talking about here are examples of delegation. -- Greg