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 zuo
Recipients docs@python, martin.panter, rhettinger, zuo
Date 2021-12-07.20:55:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1638910549.1.0.676419673361.issue20751@roundup.psfhosted.org>
In-reply-to
Content
So the current (after the aforementioned commit) form of the description is:

   A dotted lookup such as ``super(A, a).x`` searches
   ``obj.__class__.__mro__`` for a base class ``B`` following ``A`` and then
   returns ``B.__dict__['x'].__get__(a, A)``.  If not a descriptor, ``x`` is
   returned unchanged.

I guess here ``obj`` was supposed to be ``a``.

But is the description correct when it comes to what class is used where?
I.e., shouldn't it be rather something along the lines of the following:

   A dotted lookup such as ``super(A, obj).x`` (where ``obj`` is an
   instance of ``A`` of some other subclass of ``A``) searches
   ``A.__mro__`` for a base class ``B`` whose `__dict__` contains name
   ``"x"`` and then returns ``B.__dict__['x'].__get__(obj, type(obj))``.
   If ``B.__dict__['x']`` is not a descriptor, it is returned unchanged.

***

Ad my comment #2 -- yes, it became groundless with time... Minor explanation: when I reported this issue in 2015, the signature of `object.__get__` was documented just as "__get__(self, instance, owner)" (see: https://docs.python.org/3.5/reference/datamodel.html#implementing-descriptors); that's why I wrote about an inconsistency.
History
Date User Action Args
2021-12-07 20:55:49zuosetrecipients: + zuo, rhettinger, docs@python, martin.panter
2021-12-07 20:55:49zuosetmessageid: <1638910549.1.0.676419673361.issue20751@roundup.psfhosted.org>
2021-12-07 20:55:49zuolinkissue20751 messages
2021-12-07 20:55:48zuocreate