A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-October/029155.html below:

[Python-Dev] perplexed by mro

[Python-Dev] perplexed by mro [Python-Dev] perplexed by mroMartin v. Loewis martin@v.loewis.de
04 Oct 2002 07:24:40 +0200
Greg Ewing <greg@cosc.canterbury.ac.nz> writes:

> It worries me that when I write a super call, I'll
> never be sure which method is going to be called,
> because someone might inherit me and mess with
> my mro.

That's why it is called a "cooperative super call". Derived classes
can *always* mess it up (be it methods or state), but this approach
provides a pattern for the use case "invoke all of the base methods,
and each of them once".

There are cases where this is useful, and cases where this is not
useful. In cases where it is useful, you have to trust derived classes
to follow the pattern. Since the pattern is easy to follow, this
should not be a problem.

Regards,
Martin




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4