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/2011-April/110695.html below:

[Python-Dev] python and super

[Python-Dev] python and superP.J. Eby pje at telecommunity.com
Thu Apr 14 17:34:52 CEST 2011
At 03:55 PM 4/14/2011 +0100, Michael Foord wrote:
>Ricardo isn't suggesting that Python should always call super for 
>you, but when you *start* the chain by calling super then Python 
>could ensure that all the methods are called for you. If an 
>individual method doesn't call super then a theoretical 
>implementation could skip the parents
>methods (unless another child calls super).

That would break classes that deliberately don't call super.  I can 
think of examples in my own code that would break, especially in 
__init__() cases.

It's perfectly sensible and useful for there to be classes that 
intentionally fail to call super(), and yet have a subclass that 
wants to use super().  So, this change would expose an internal 
implementation detail of a class to its subclasses, and make "fragile 
base class" problems worse.  (i.e., where an internal change to a 
base class breaks a previously-working subclass).

More information about the Python-Dev mailing list

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