python-module-split-into-multiple-files
Tips and Tricks - Python - splitting a module into multiple files | TestDriven.io
- Refactor from a module (one file) to a package (a folder with multiple files, including
__init__.py
) - Can keep all imports from the module unchanged by rexporting the imports from
package/__init__.py
:
❗ Dramatically change this to avoid plagiarism! What did I learn in particular that adds extra value?
Before (single file module):
After (multi-file package folder):
Imports from the new package are the same as they were from the previous module: