I have an abstract base class, and every descendant is expected to have certain attributes (of type str, int, etc), hence it makes sense to document those attributes in the base class. What is the recommended format for documenting these attributes in Python 3.6+?
Asked
Active
Viewed 756 times
5
-
2Perhaps looking at the [abc module](https://docs.python.org/3.7/library/abc.html) might give you some ideas. – John Coleman Aug 26 '18 at 23:43
-
[Type hints](https://docs.python.org/3.6/library/typing.html)? – snakecharmerb Aug 27 '18 at 06:22
1 Answers
0
The best source might be PEP 257, specifically the guidance on subclassing.
From PEP 257
The docstring for a class should summarize its behavior and list the public methods and instance variables. If the class is intended to be subclassed, and has an additional interface for subclasses, this interface should be listed separately (in the docstring). The class constructor should be documented in the docstring for its init method. Individual methods should be documented by their own docstring.

captnsupremo
- 689
- 5
- 11