Docstrings for attributes?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Roy Smith

    Docstrings for attributes?

    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.
  • alex23

    #2
    Re: Docstrings for attributes?

    On Sep 28, 11:50 am, Roy Smith <r...@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:

    Comment

    Working...