I have a package mypack
with modules mod_a
and mod_b
in it. I intend the first two to be imported freely:
import mypack
import mypack.mod_a
However, I'd like to keep mod_b
for the exclusive use of mypack
. That's because it exists merely to organize the latter's internal code.
My first question is, is this -- 'private' modules -- an accepted practice in Python programming?
If yes, my second question is, what is the best way to convey this intention to the client? Do I prefix the name with an underscore (i.e. _mod_b
)? Or would it be a good idea to declare a sub-package private
and place all such modules there?