Best way to do attribute docstrings?

Ken Kuhlman kskuhlman at gmail.com
Tue Sep 11 21:52:25 CEST 2007


Thanks for the response!  It was just the kick I needed to realize
that I was letting my frustration get the best of me and that I was
going down a dead-end.  I blame the fact that I was coding on little
sleep :-)

I went with the solution of giving a naming convention to the
docstrings and relying on that for the introspection -- that's a lot
less of a kludge than what I was attempting.

I still think it would be great if you could do something like:
@doc('Animal has four legs')
four_legs = True

IMHO, that syntax is nice (which was the objection to PEP 224), but
I'm not going to try to propose another PEP over it.  My itch is
scratched for now -- if the naming convention hack gets under my skin
eventually I'll try going down a source parsing route next.

Thanks again for the help!
-Ken

PS:  I hope it's OK that I ignored your questions -- my initial
solution was just too hideous to be scrutinized too closely.




More information about the Python-list mailing list