Skip to content

Commit 3f6a269

Browse files
[DOCUMENTAITON] Part one of reviewing core API documentation.
Changes in file multicast/__init__.py: * Added note that some dunder can be ignored by users * Added trivial doctests to some dunder
1 parent 89d3f8f commit 3f6a269

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

multicast/__init__.py

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,35 @@
6767
"""hear.McastHEAR""", # skipcq: PYL-E0603 -- imports ok
6868
]
6969

70+
__path__ = [__file__[0:-12]]
71+
"""The sequence of strings enumerating the locations where the package’s submodules will be found.
72+
73+
The `__path__` attribute, like many dunder attributes, is associated with the implementation
74+
of Python language features. When utilizing this module as an imported module or a
75+
command-line interface (CLI) tool, the `__path__` attribute can be safely disregarded.
76+
77+
Minimal Acceptance Testing:
78+
79+
First set up test fixtures by importing multicast.
80+
81+
>>> import multicast as _multicast
82+
>>>
83+
84+
>>> _multicast.__path__ is not None
85+
True
86+
>>>
87+
88+
"""
89+
7090
__package__ = "multicast" # skipcq: PYL-W0622
7191
"""The package of this program.
7292
93+
The `__package__` attribute, like many dunder attributes, was associated with the implementation
94+
of Python language features. When utilizing this module as an imported module or a
95+
command-line interface (CLI) tool, the `__package__` attribute can be safely disregarded.
96+
Within the context of this module, `__package__` serves as a convenient constant that holds
97+
the name of the package.
98+
7399
Minimal Acceptance Testing:
74100
75101
First set up test fixtures by importing multicast.
@@ -81,11 +107,32 @@
81107
True
82108
>>>
83109
110+
Testcase 0: multicast.__package__ should be the string "multicast".
111+
A: Test that the __package__ attribute is initialized.
112+
B: Test that the __package__ attribute is a string.
113+
C: Test that the __package__ attribute has a value of "multicast".
114+
115+
>>> _multicast.__package__ is not None
116+
True
117+
>>> type(_multicast.__package__) == type(str())
118+
True
119+
>>> type(_multicast.__package__)
120+
<class 'str'>
121+
>>> _multicast.__package__
122+
"multicast"
123+
>>>
124+
84125
"""
85126

86127
__module__ = "multicast"
87128
"""The module of this program.
88129
130+
The `__module__` attribute, like many dunder attributes, is associated with the implementation
131+
of Python language features. When utilizing this module as an imported module or a
132+
command-line interface (CLI) tool, the `__module__` attribute can be safely disregarded.
133+
Within the context of this module, `__module__` serves as a convenient constant that holds
134+
the name of the module.
135+
89136
Minimal Acceptance Testing:
90137
91138
First set up test fixtures by importing multicast.
@@ -97,6 +144,21 @@
97144
True
98145
>>>
99146
147+
Testcase 0: multicast.__module__ should be the string "multicast".
148+
A: Test that the __module__ attribute is initialized.
149+
B: Test that the __module__ attribute is a string.
150+
C: Test that the __module__ attribute has a value of "multicast".
151+
152+
>>> _multicast.__module__ is not None
153+
True
154+
>>> type(_multicast.__module__) == type(str())
155+
True
156+
>>> type(_multicast.__module__)
157+
<class 'str'>
158+
>>> _multicast.__module__
159+
"multicast"
160+
>>>
161+
100162
"""
101163

102164
__name__ = "multicast" # skipcq: PYL-W0622

0 commit comments

Comments
 (0)