How can we restrict other modules from importing certain functions while allowing others.
Desired behavior
# module A: a.py
def foo():
print('foo')
def bar():
print('bar')
# module B: b.py
from a import foo # error, foo not found in a
from a import bar # okay!
EDIT:
When someone writes from a import foo
they should get error of some sorts. This way I can restrict people from importing functions that are meant to be only called from the functions in the same file.