What does __all__
do in python?
- module
# example.py
__all__ = ['print_details']
def print_public():
print('this method is public')
def print_private():
print('this method is private')
>>> from example import *
>>> print_public()
this method is public
>>> print_private()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'print_private' is not defined