__all__, from helpers import *
If you have some features that you want to keep confidential, you can prefix their names with underscores. From my testing, this stops the execution of functions fromimport *
For example, in helper.py:
def _HiddenFunc():
return "Something"
def AnActualFunc():
return "Hello"
Then:
>>> from helper import *
>>> AnActualFunc()
'Hello'
>>> _HiddenFunc()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name '_HiddenFunc' is not defined
source
share