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 _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/HE2HDBITU7PLOJCCQ6UKFKZSZDZM44Z6/ Code of Conduct: http://python.org/psf/codeofconduct/