@@ -139,20 +139,20 @@ that [the official Python documentation](https://docs.python.org/3/) uses.
139
139
By default, sphinx expects you to write docstrings like this:
140
140
141
141
``` python
142
- class Vehicle ( object ) :
143
- '''
144
- The Vehicle object contains lots of vehicles.
142
+ class Vehicles :
143
+ """
144
+ The Vehicles object contains lots of vehicles.
145
145
:param arg: The arg is used for ...
146
146
:type arg: str
147
147
:ivar arg: This is where we store arg
148
148
:vartype arg: str
149
- '''
149
+ """
150
150
151
151
def __init__ (self , arg ):
152
152
self .arg = arg
153
153
154
154
def cars (self , distance , destination ):
155
- ''' We can't travel a certain distance in vehicles without fuels, so here's the fuels
155
+ """ We can't travel a certain distance in vehicles without fuels, so here's the fuels
156
156
157
157
:param distance: The amount of distance traveled
158
158
:type amount: int
@@ -161,7 +161,7 @@ class Vehicle(object):
161
161
162
162
:returns: A Car mileage
163
163
:rtype: Cars
164
- '''
164
+ """
165
165
...
166
166
```
167
167
@@ -172,22 +172,22 @@ Sphinx can be configured to use that with
172
172
[ sphinx.ext.napoleon] ( https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html ) .
173
173
174
174
``` python
175
- class Vehicles ( object ) :
176
- '''
177
- The Vehicle object contains a lot of vehicles
175
+ class Vehicles :
176
+ """
177
+ The Vehicles object contains lots of vehicles.
178
178
179
179
Args:
180
180
arg (str): The arg is used for...
181
181
182
182
Attributes:
183
- arg (str): This is where we store arg,
184
- '''
183
+ arg (str): This is where we store arg.
184
+ """
185
185
186
186
def __init__ (self , arg ):
187
187
self .arg = arg
188
188
189
189
def cars (self , distance , destination ):
190
- ''' We can't travel distance in vehicles without fuels, so here is the fuels
190
+ """ We can't travel distance in vehicles without fuels, so here is the fuels
191
191
192
192
Args:
193
193
distance (int): The amount of distance traveled
@@ -198,7 +198,7 @@ class Vehicles(object):
198
198
199
199
Returns:
200
200
cars: A car mileage
201
- '''
201
+ """
202
202
...
203
203
204
204
```
@@ -207,13 +207,11 @@ class Vehicles(object):
207
207
208
208
[ Numpy] ( https://numpy.org/ ) is a large and popular Python library,
209
209
and numpy developers have their own docstring style.
210
- It is an excellent choice if you want to do detailed documentation,
211
- i.e., extensive documentation of all the functions and parameters.
212
210
213
211
``` python
214
- class Vehicles ( object ) :
215
- '''
216
- The Vehicles object contains lots of vehicles
212
+ class Vehicles :
213
+ """
214
+ The Vehicles object contains lots of vehicles.
217
215
218
216
Parameters
219
217
----------
@@ -227,14 +225,14 @@ class Vehicles(object):
227
225
Attributes
228
226
----------
229
227
arg : str
230
- This is where we store arg,
231
- '''
228
+ This is where we store arg.
229
+ """
232
230
233
231
def __init__ (self , arg ):
234
232
self .arg = arg
235
233
236
234
def cars (self , distance , destination ):
237
- ''' We can't travel distance in vehicles without fuels, so here is the fuels
235
+ """ We can't travel distance in vehicles without fuels, so here is the fuels
238
236
239
237
Parameters
240
238
----------
@@ -252,7 +250,7 @@ class Vehicles(object):
252
250
-------
253
251
cars
254
252
A car mileage
255
- '''
253
+ """
256
254
pass
257
255
```
258
256
0 commit comments