<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 2 Jul 2016, at 18:58, Guido van Rossum <<a href="mailto:gvanrossum@gmail.com" class="">gvanrossum@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">No, super() does not (directly) call multiple functions. The function it calls has to call the next with another super() call. Also, __init__() is not special, nor is **kwds</p></div></blockquote><div><div><br class=""></div><div>The thing I do not understand is why did super() call 2 __init__ functions given the code I attached?</div><div>The one in QObject and the one in Age.</div></div><div><br class=""></div><div>This is the output I get with python 3.5:</div><div><br class=""></div><div><div>$ python3.5 super_example.py</div><div>instance of Person.__init__</div><div>instance of QObject.__init__</div><div>instance of Age.__init__</div><div>Person.describe()</div><div>name: Barry</div><div>QObject.describe()</div></div><div><br class=""></div><div>I see no obvious code that should call Age.__init__, which is why I concluded that there is something about super() that is not documented.</div><br class=""><blockquote type="cite" class=""><p dir="ltr" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">super() itself is special, it knows the class and instance.</p><p dir="ltr" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">There are conventions around all of this though. It may be worth documenting those, as long as it is made clear which part of the docs is about conventions (as opposed to how things work).</p></blockquote><blockquote type="cite" class=""><div class=""><p dir="ltr" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">There are also opinions about those conventions. Here I am not so sure that they belong in the docs.</p></div></blockquote><div>Agreed.</div><div><br class=""></div><div>Barry</div><br class=""><blockquote type="cite" class=""><div class=""><p dir="ltr" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">--Guido (mobile)</p><div class="gmail_quote" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Jul 2, 2016 10:32 AM, "Barry Scott" <<a href="mailto:barry@barrys-emacs.org" class="">barry@barrys-emacs.org</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">I have read the python3.5 docs for super() and<br class=""><a href="https://rhettinger.wordpress.com/2011/05/26/super-considered-super/" rel="noreferrer" target="_blank" class="">https://rhettinger.wordpress.com/2011/05/26/super-considered-super/</a>.<br class=""><br class="">Between the two sources I still have no clear idea of what super() will<br class="">do and why it will doe what it does.<br class=""><br class="">I hope to get feedback that can be used as the basis to update the python docs.<br class=""><br class="">For single inheritance the use of super() does not seem to have any surprises.<br class=""><br class="">But in the case of a class with multiple-inheritance more then 1 function<br class="">may be called by 1 call to super().<br class=""><br class="">What are the rules for which functions are called by super() in the multiple<br class="">inheritance case?<br class=""><br class="">Is __init__ special or can other super() calls end up<br class="">calling more then 1 function?<br class=""><br class="">What is the role of **kwds with super()?<br class=""><br class="">Here is the code I used to show the __init__ multiple calls.<br class=""><br class="">The attached example shows that one call to super() causes 2 to<br class="">__init__ of bases of Person. But describe does not follow the pattern<br class="">Age.describe is not called.<br class=""><br class="">Barry<br class=""><br class="">_______________________________________________<br class="">Python-ideas mailing list<br class=""><a href="mailto:Python-ideas@python.org" class="">Python-ideas@python.org</a><br class=""><a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank" class="">https://mail.python.org/mailman/listinfo/python-ideas</a><br class="">Code of Conduct:<span class="Apple-converted-space"> </span><a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank" class="">http://python.org/psf/codeofconduct/</a></blockquote></div></div></blockquote></div><br class=""></body></html>