File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -132,3 +132,39 @@ def f():
132
132
:::{.callout-note}
133
133
Linking to functions documented outside your package must be configured in the [ interlinks filter] ( ./interlinks.qmd ) .
134
134
:::
135
+
136
+
137
+ ## How do I document a class?
138
+
139
+ See [ this numpydoc page on documenting classes] ( https://numpydoc.readthedocs.io/en/latest/format.html#documenting-classes ) .
140
+
141
+ Below is a simple example of a class docstring.
142
+
143
+ ``` python
144
+ class MyClass :
145
+ """ A great class.
146
+
147
+ Parameters
148
+ ----------
149
+ a:
150
+ Some parameter.
151
+
152
+ Attributes
153
+ ----------
154
+ x:
155
+ An integer
156
+ """
157
+
158
+
159
+ x: int = 1
160
+
161
+
162
+ def __init__ (self , a : str ):
163
+ self .a = a
164
+ ```
165
+
166
+ Note these two important pieces:
167
+
168
+ * Document your ` __init__ ` method parameters on the class docstring.
169
+ * You can use an ` Attributes ` section in your docstring.
170
+
You can’t perform that action at this time.
0 commit comments