Message255511
I actually found this in Python2, but it is still unchanged in Python 3.6 dev. Namely, creating an instance of a class derived from property will drop the docstring passed explicitly to the constructor:
torsten@defiant:~$ python3.6
Python 3.6.0a0 (default:9fcfdb53e8af, Nov 27 2015, 23:11:09)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> property(doc="Hello world").__doc__
'Hello world'
>>> class SubProp(property): pass
...
>>> SubProp(doc="Hello world").__doc__
>>>
This war surprising to me. I actually used a subclass of property to describe fields of configuration classes with extensive documentation, which disappeared during runtime.
In Python2 I work around this by assigning to __doc__ as the last thing in the constructor of my SubProp class. |
|
Date |
User |
Action |
Args |
2015-11-27 23:43:52 | torsten | set | recipients:
+ torsten |
2015-11-27 23:43:52 | torsten | set | messageid: <1448667832.51.0.334598445629.issue25757@psf.upfronthosting.co.za> |
2015-11-27 23:43:52 | torsten | link | issue25757 messages |
2015-11-27 23:43:52 | torsten | create | |
|