Author jmg
Recipients eric.smith, jmg
Date 2020-11-20.18:18:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1605896310.08.0.662421352734.issue42414@roundup.psfhosted.org>
In-reply-to
Content
As I said, I expect it to work similar to how property works:
```
>>> class Foo:
...  def getx(self):
...   return 5
...  x = property(getx, doc='document the x property')
... 
>>> help(Foo)
Help on class Foo in module __main__:

class Foo(builtins.object)
 |  Methods defined here:
 |  
 |  getx(self)
 |  
 |  ----------------------------------------------------------------------
 |  Readonly properties defined here:
 |  
 |  x
 |      document the x property
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)
```

The pure python implementation of property is at: https://docs.python.org/3/howto/descriptor.html#properties

which uses the descriptor protocal as documented in: https://docs.python.org/3/howto/descriptor.html

Which uses an object w/ __get__/__set__/__delete__ to emulate attribute access, and that object can have the __doc__ property set on it to provide documentation.
History
Date User Action Args
2020-11-20 18:18:30jmgsetrecipients: + jmg, eric.smith
2020-11-20 18:18:30jmgsetmessageid: <1605896310.08.0.662421352734.issue42414@roundup.psfhosted.org>
2020-11-20 18:18:30jmglinkissue42414 messages
2020-11-20 18:18:29jmgcreate