forked from scientific-python/cookie
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
37 lines (28 loc) · 803 Bytes
/
example.py
File metadata and controls
37 lines (28 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""Behold, module level docstring."""
class Example:
"""This class exists to show off autodocstring generation."""
def add(self, a: int, b: int) -> int:
"""Add two integers.
Notes
-----
Docstring can be useful. I promise.
Parameters
----------
a: First integer to add.
b: Second integer to add.
Returns
-------
The sum of the two integers.
"""
return a + b
def subtract(self, a: int, b: int) -> int:
"""Subtract two integers.
Parameters
----------
a: Integer to subtract from.
b: Integer to subtract.
Returns
-------
The difference of the two integers.
"""
return a - b