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

Jan Kaliszewski report at bugs.python.org
Sun Dec 12 17:16:59 EST 2021


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

Sure. But don't you think there should be ``.__get__(a, type(a))`` rather than ``.__get__(a, A)``? Then the whole statement would be true regardless of whether A is the actual type of a, or only a superclass of the type of a.

That would also be more consistent with the second point of the description, i.e., the one about *Instance Binding* (where we have ``type(a).__dict__['x'].__get__(a, type(a))``).

Also, I believe that ``type(a).__mro__`` would be more consistent (than ``a.__class__.mro``) with that point.

----------

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


More information about the Python-bugs-list mailing list