John-Mark Gurney <j...@funkthat.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42414>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to