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 cryvate
Recipients Paul Pinterits, cryvate, docs@python
Date 2017-10-10.08:46:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507625191.24.0.213398074469.issue31735@psf.upfronthosting.co.za>
In-reply-to
Content
"We know this doesn't happen because nothing is printed to stdout."

Try running Obj().d, you will get output.

Obj.d does not work because it is on a *class*, and so it runs, per the docs:

'Obj.__dict__['d'].__get__(None, Obj)'

whereas you consider running it on an instance to get:

b = Obj()
b.d
# equivalent to
type(b).__dict__['d'].__get__(b, type(b))

and you will get output twice.

[Note, on python2 you will get an error, I think this is because your class does not inherit from object.]
History
Date User Action Args
2017-10-10 08:46:31cryvatesetrecipients: + cryvate, docs@python, Paul Pinterits
2017-10-10 08:46:31cryvatesetmessageid: <1507625191.24.0.213398074469.issue31735@psf.upfronthosting.co.za>
2017-10-10 08:46:31cryvatelinkissue31735 messages
2017-10-10 08:46:31cryvatecreate