[Python-ideas] Attribute Docstrings and Annotations
rrr at ronadam.com
Wed Jan 3 01:14:38 CET 2007
Jim Jewett wrote:
> On 1/2/07, Josiah Carlson <jcarlson at uci.edu> wrote:
>> I have never needed attribute annotations
> For some classes, I document the intended use of certain attributes
> with a comment. Making this introspectable would be good.
> I've snipped the rest because I agree it wouldn't be worth the
> wordiness it would cause with any syntax I've seen so far.
I feel the correct way to do this is to just put the attribute comment in the
doc string of the object that contains the attribute. Simple attributes are
usually just that, simple values related to the object. Yes, it makes the doc
string longer, but it also tends to makes for better documentation as well.
Why make things more complex than they need to be?
More information about the Python-ideas