This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients docs@python, gsnedders, rhettinger
Date 2019-06-04.17:56:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1559670966.97.0.567285398577.issue37145@roundup.psfhosted.org>
In-reply-to
Content
Hit <submit> too early.

In Python, the norm is that the class name is documented.  When you call the class, the __init__() method gets called automatically (as documented in the language reference and in the tutorial).

For example:

    >>> class A:
            def __init__(self, seq):
                    self._seq = seq
            def __len__(self):
                    return len(self._seq)
      
    >>> a = A('apple')
    >>> len(a)	  
    5

In this example, we document that class "A" can be called with a sequence and that len() can be called on instances of A.  The "dunder" methods are public, but are called and documented indirectly.  The "_seq" attribute is marked as private and would not be documented, since it is an implementation detail and not intended to be accessed directly.
History
Date User Action Args
2019-06-04 17:56:06rhettingersetrecipients: + rhettinger, docs@python, gsnedders
2019-06-04 17:56:06rhettingersetmessageid: <1559670966.97.0.567285398577.issue37145@roundup.psfhosted.org>
2019-06-04 17:56:06rhettingerlinkissue37145 messages
2019-06-04 17:56:06rhettingercreate