-
Notifications
You must be signed in to change notification settings - Fork 6
/
ClassExample.py
38 lines (29 loc) · 1.04 KB
/
ClassExample.py
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
38
class ClassExample():
'''This first line is a summary of this class. \
There must be ONLY one logical line in this overview.
However (notice that must be an empty line between the summary and this
block of text), the rest of this doctrings can be placed in several lines.
These lines usually provides extended information about the functionality
of the class. The last line of the docstring should contain only
three simple quotation marks.
'''
x = 1
def __init__(self):
'''A summary about the constructor. This is an example of a one-line docstring.'''
print(self.x)
def set(self, x):
'''A summary about \"set\".
Arguments:
x: an integer that ... bla, bla, bla.
Returns:
Nothing.
'''
self.x = x
def get(self):
'''A summary about \"get\".
Arguments:
None.
Returns:
The value of \"x\".
'''
return self.x