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

2021-12-26 Thread Arthur Milchior
Change by Arthur Milchior : -- pull_requests: +28486 pull_request: https://github.com/python/cpython/pull/30271 ___ Python tracker ___ _

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

2021-12-26 Thread Arthur Milchior
Arthur Milchior added the comment: "a base class ``B`` following ``A``" shouldn't it be "the base class"? . After all, there is at most one base class following ``A``. Also, I find it unclear what means "``x`` is returned unchanged, since in this context ``x`` is not a value which exists by

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

2021-12-26 Thread Arthur Milchior
Arthur Milchior added the comment: Shouldn't those change be ported to 3.10 and maybe even earlier version? They are great, but hard to find if you read the current version manual. I'm just surprised by the term "dotted lookup". The remaining of the documentation mention "attribute access".

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

2021-12-12 Thread Jan Kaliszewski
Jan Kaliszewski 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 consist

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

2021-12-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I guess here ``obj`` was supposed to be ``a``. Okay, I updated the variable name to match the rest of the example. > But is the description correct when it comes to what class is used where? It looks fine to me. It is harmonious with the other three en

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

2021-12-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 4b1cfc1f30327e76a2d845cc274be56b34b1 by Raymond Hettinger in branch 'main': bpo-20751: Match variable name to the example. (GH-29980) https://github.com/python/cpython/commit/4b1cfc1f30327e76a2d845cc274be56b34b1 --

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

2021-12-07 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +28206 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/29980 ___ Python tracker ___ ___

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

2021-12-07 Thread Jan Kaliszewski
Jan Kaliszewski 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 `

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

2021-12-07 Thread Jan Kaliszewski
Jan Kaliszewski added the comment: Sorry, a few mistakes distorted my proposal. 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 ``A.__mro__`` for a base class whose `__dict__` contains name ``"x"``, a

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

2021-12-07 Thread Jan Kaliszewski
Jan Kaliszewski added the comment: 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 n

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

2021-12-03 Thread Raymond Hettinger
Change by Raymond Hettinger : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list

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

2021-12-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 135ecc3492cee259090fd4aaed9056c130cd2eba by Raymond Hettinger in branch 'main': bpo-20751: Replace method example with attribute example, matching the descriptor howto (GH-29909) https://github.com/python/cpython/commit/135ecc3492cee259090f

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

2021-12-03 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +28134 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/29909 ___ Python tracker ___

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

2021-12-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: Regarding comment #1, The wording is correct and there was a reason for using a method. While super() can be used for attribute lookup, use cases are almost entirely dominated by method lookups. For many users, an attribute lookup with super() is unconv

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

2021-12-03 Thread Raymond Hettinger
Change by Raymond Hettinger : -- title: Misleading descriptor protocol documentation: direct call, super binding -> Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs ___ Python tracker