Docstrings for attributes?

alex23 wuwei23 at gmail.com
Sat Sep 27 22:04:39 EDT 2008


On Sep 28, 11:50 am, Roy Smith <r... at panix.com> wrote:
> Is there any way to attach a docstring to an attribute?  I see that PEP-257
> talks about attribute docstrings, but it references PDP-258, which was
> rejected.
>
> I suppose I could eschew plain attributes in favor of getter functions,
> because those give me a place to hang a docstring, but that feels like the
> wrong thing to do.

There were a couple of solutions provided - including the use of
properties - when this question came up earlier this week:
http://groups.google.com/group/comp.lang.python/browse_frm/thread/18a8c3f09ac02f85#



More information about the Python-list mailing list