[Python-ideas] documentation for python3 super()

Barry Scott barry at barrys-emacs.org
Sat Jul 2 12:55:13 EDT 2016


I have read the python3.5 docs for super() and
https://rhettinger.wordpress.com/2011/05/26/super-considered-super/.

Between the two sources I still have no clear idea of what super() will
do and why it will doe what it does.

I hope to get feedback that can be used as the basis to update the python docs.

For single inheritance the use of super() does not seem to have any surprises.

But in the case of a class with multiple-inheritance more then 1 function
may be called by 1 call to super().

What are the rules for which functions are called by super() in the multiple
inheritance case?

Is __init__ special or can other super() calls end up
calling more then 1 function?

What is the role of **kwds with super()?

Here is the code I used to show the __init__ multiple calls.

The attached example shows that one call to super() causes 2 to
__init__ of bases of Person. But describe does not follow the pattern
Age.describe is not called.

Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: super_example.py
Type: text/x-python-script
Size: 820 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160702/1db05565/attachment.bin>


More information about the Python-ideas mailing list