I found as follow in PEP 8.
_single_leading_underscore: weak "internal use" indicator. E.g. "from M import *" does not import objects whose name starts with an
from A import *
a_class = Test()
from A import * imported the class
Test. If you had another class ... e.g.
_Test, it wouldn't be imported.
Basically, once an object has been imported, all of it's methods/properties are accessible. The leading underscore only prevents top-level objects from being imported (and only when using
from module import *).
e.g. with the following
class Test(object): pass class _Test(object): pass
>>> from a import * >>> Test <class 'a.Test'> >>> _Test Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name '_Test' is not defined