Message304021
"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.] |
|
Date |
User |
Action |
Args |
2017-10-10 08:46:31 | cryvate | set | recipients:
+ cryvate, docs@python, Paul Pinterits |
2017-10-10 08:46:31 | cryvate | set | messageid: <1507625191.24.0.213398074469.issue31735@psf.upfronthosting.co.za> |
2017-10-10 08:46:31 | cryvate | link | issue31735 messages |
2017-10-10 08:46:31 | cryvate | create | |
|