I have a module with many simple helper functions, but it is getting large and tedious to maintain. I'd like to break it into a simple package. My package directory is defined on PYTHONPATH, and looks like this:
test
|--__init__.py <---this is empty
|--a.py
|--b.py
This is imported in the usual way (import test) but upon inspection (dir(test)) the library does not contain the modules a or b, just some top level attributes. I could use a hint what is going wrong. thanks!
Solution from below: the init file now auto-loads modules that I want access to every time. This respects the absolute path assumptions inherent to Python 3.4.
from .a import a
from .b import b
Follow-Up: My intent was to have each helper script as its own module, leading to perhaps many small modules that are easy to find and maintain. Is this idiomatic? inefficient? I get the maintenance implications to the init file. Any experience or best practices to share? thanks.