[issue31441] Descriptor example in documentation is confusing, possibly wrong

2021-12-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: This example was removed and replaced with better examples. -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker _

[issue31441] Descriptor example in documentation is confusing, possibly wrong

2021-12-03 Thread Irit Katriel
Irit Katriel added the comment: see also issue20751. -- nosy: +iritkatriel ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue31441] Descriptor example in documentation is confusing, possibly wrong

2017-09-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: The example should be modernized to show-off the new __set_name__() part of the descriptor protocol. Computing the name on-demand is better that relying an optional user entered alternate name and having to store that name for future reference. --

[issue31441] Descriptor example in documentation is confusing, possibly wrong

2017-09-13 Thread R. David Murray
R. David Murray added the comment: Here is a not-much-more-complicated version that solves the problem. It is probably worth changing as the revised example makes clear the difference between self and obj, which is an important distinction. class RevealAccess(object):

[issue31441] Descriptor example in documentation is confusing, possibly wrong

2017-09-13 Thread Benjamin Wohlwend
New submission from Benjamin Wohlwend: The first descriptor example in the descriptor docs (https://docs.python.org/3/howto/descriptor.html#descriptor-example) stores the value on the descriptor instance, which is shared among all MyClass instances. This leads to surprising (and arguably buggy