[Python-3000] [Fwd: features i'd like [Python 3000] ... #3: fix super()]

Jan Grant jan.grant at bristol.ac.uk
Wed Dec 6 10:43:15 CET 2006


On Mon, 4 Dec 2006, Ben Wing wrote:

> as a result, i imagine there's a strong urge to just hardcode the name 
> of the parent
     ^^^^^^^^^^

> -- super.meth(args) calls the superclass method `meth'
                            ^^^^^^^^^^^^^^

Python supports multiple inheritance, unlike Java; the design mantra is 
"explicit is better than implicit" and "ambiguity should be an error". 
Two! The two design mantras are...

> -- as an alternative or in addition, super(args) would work like 
> super.meth(args) if we're currently inside of `meth' in a subclass.  i 
> suspect that 90% of the time or more, `super' is used to chain to the 
> superclass version of an overridden method, and this optimizes for the 
> common case.

Commonly you know what the method is called at the point where you're 
typing "super" :-)

-- 
jan grant, ISYS, University of Bristol. http://www.bris.ac.uk/
Tel +44 (0)117 3317661   http://ioctl.org/jan/
Not as randy or clumsom as a blaster.


More information about the Python-3000 mailing list