-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass_docstring.txt
More file actions
48 lines (45 loc) · 1.33 KB
/
class_docstring.txt
File metadata and controls
48 lines (45 loc) · 1.33 KB
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
39
40
41
42
43
44
45
46
47
48
Here is your output:
Help on class Person in module submission:
class Person(builtins.object)
| Methods defined here:
|
| __init__(self, name)
| Initialize self. See help(type(self)) for accurate signature.
|
| greeting(self)
| Outputs a message with the name of the person
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
>>> class Apple:
... def __init__(self, color, flavor):
... self.color = color
... self.flavor = flavor
... def __str__(self):
... return "This apple is {} and its flavor is {}".format(self.color, self.flavor)
...
>>> help(Apple)
Help on class Apple in module __main__:
class Apple(builtins.object)
| Methods defined here:
|
| __init__(self, color, flavor)
| Initialize self. See help(type(self)) for accurate signature.
|
| __str__(self)
| Return str(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)