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 Paul Pinterits
Recipients Paul Pinterits, docs@python
Date 2017-10-09.15:04:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507561484.86.0.213398074469.issue31735@psf.upfronthosting.co.za>
In-reply-to
Content
The [descriptor howto](https://docs.python.org/3/howto/descriptor.html#invoking-descriptors) states:

"For example, obj.d looks up d in the dictionary of obj. If d defines the method __get__(), then d.__get__(obj) is invoked [...]"

This is not true - the descriptor obtained from obj's dictionary is never invoked. If it was, the following two snippets would produce output:


class Class:
    pass

obj = Class()
obj.__dict__['d'] = property(lambda: print('called'))

_ = obj.d  # nothing is printed.


class Obj:
    @property
    def d(self):
        print('called')

_ = Obj.d  # nothing is printed.
History
Date User Action Args
2017-10-09 15:04:44Paul Pinteritssetrecipients: + Paul Pinterits, docs@python
2017-10-09 15:04:44Paul Pinteritssetmessageid: <1507561484.86.0.213398074469.issue31735@psf.upfronthosting.co.za>
2017-10-09 15:04:44Paul Pinteritslinkissue31735 messages
2017-10-09 15:04:44Paul Pinteritscreate