[Python-ideas] documentation for python3 super()

Chris Angelico rosuav at gmail.com
Mon Jul 4 19:06:05 EDT 2016


On Tue, Jul 5, 2016 at 12:16 AM, Barry Scott <barry at barrys-emacs.org> wrote:
> In engineer English something like this.
>
> "super() uses the __mro__ as the order to search for the attribute to return.
> super() starts by finding the type in the __mro__ and then examines the following
> items until the attribute is found and returns it. If the attribute is not found
> AttributeError is raised.”
>
> Thoughts?

Nitpick: Instead of saying "the __mro__", I'd say something like "the
Method Resolution Order (found in cls.__mro__)" first time and "the
MRO" second. The MRO is a feature of the class; it happens to be made
available in the attribute __mro__, but that's secondary.

ChrisA


More information about the Python-ideas mailing list