[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs

Jan Kaliszewski report at bugs.python.org
Tue Dec 7 16:10:56 EST 2021


Jan Kaliszewski <zuo at kaliszewski.net> added the comment:

I am very sorry, I just noticed another mistake.

It should be:

   A dotted lookup such as ``super(A, obj).x`` (where ``obj``
   is an instance of ``A`` or of a subclass of ``A``) searches
   ``type(obj).__mro__`` for such a base class ``B`` that follows
   ``A`` and whose :attr:`__dict__` contains the name ``"x"``;
   then ``B.__dict__['x'].__get__(obj, type(obj))`` is returned.
   If not a descriptor, ``B.__dict__['x']`` is returned unchanged.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________


More information about the Python-bugs-list mailing list