This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Juchen Zeng
Recipients Juchen Zeng, docs@python, martin.panter
Date 2015-12-02.12:22:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1449058941.53.0.26351823319.issue25777@psf.upfronthosting.co.za>
In-reply-to
Content
[Doc Link](https://docs.python.org/2/howto/descriptor.html#invoking-descriptors)

In descriptions about how to invoke descriptors with super(), it says:

    The call super(B, obj).m() searches obj.__class__.__mro__ for the base class A immediately following B and then returns A.__dict__['m'].__get__(obj, B). If not a descriptor, m is returned unchanged. If not in the dictionary, m reverts to a search using object.__getattribute__().

But the call ` super(B, obj).m()` will not return `A.__dict__['m'].__get__(obj, B)`, it will trigger the `__call__` method of ` A.__dict__['m'].__get__(obj, B)` if it has that attr, and return what this `__call__` method returns.  It could be anything.
It's actually `super(B, obj).m` returns `A.__dict__['m'].__get__(obj, B)` if m is a descriptor.

In short, the original description in the doc can be abbreviated to:
`The call super(B, obj).m() [did something] and returns A.__dict__['m'].__get__(obj, B).`
Which is obviously misleading.

As the method/function call isn't the core part in this sentence. I suggest the doc to be fixed like this:

    The action super(B, obj).m searches obj.__class__.__mro__ for the base class A immediately following B and then returns A.__dict__['m'].__get__(obj, B).
History
Date User Action Args
2015-12-02 12:22:21Juchen Zengsetrecipients: + Juchen Zeng, docs@python, martin.panter
2015-12-02 12:22:21Juchen Zengsetmessageid: <1449058941.53.0.26351823319.issue25777@psf.upfronthosting.co.za>
2015-12-02 12:22:21Juchen Zenglinkissue25777 messages
2015-12-02 12:22:21Juchen Zengcreate