[docs] [issue31735] Documentation incorrectly states how descriptors are invoked

Paul Pinterits report at bugs.python.org
Mon Oct 9 12:55:22 EDT 2017

Paul Pinterits <rawing7 at gmail.com> added the comment:

If we take this class:

class Obj:
    def d(self):

And we access Obj.d:

_ = Obj.d

According to the docs, the following should happen:

# obj.d looks up d in the dictionary of obj
d = Obj.__dict__['d']

# If d defines the method __get__(),
if hasattr(d, '__get__'):

    # then d.__get__(obj) is invoked

We know this doesn't happen because nothing is printed to stdout.


Python tracker <report at bugs.python.org>

More information about the docs mailing list