Suppose I have a module:
mymodule/example.py:
def add_one(number):
return number + 1
And mymodule/__init__.py:
from .example import *
foo = "FOO"
def bar():
return 1
Now I see the function at the root of mymodule:
>>> import mymodule
>>> mymodule.add_one(3)
4
>>> mymodule.foo
'FOO'
Also, I see imported add_one through dir along with example:
>>> dir(mymodule)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'add_one', 'bar', 'example', 'foo']
But when I type help(mymodule) I see only example, foo and bar, but not the imported add_one:
Help on package mymodule:
NAME
mymodule
PACKAGE CONTENTS
example
FUNCTIONS
bar()
DATA
foo = 'FOO'
But I can call add_one() as the root function of mymodule. Is it possible to see it in help as root function?