A small python utility for auto-completing __all__ and binding sub-modules in __init__.py files.
How to Use
Add these lines to the top of your __init__.py.
import allset allset.set_all_submodules(globals()) allset.bind_all_submodules(globals()) del allset
Now you can reference any sub-module with import mysubmodule or from mysubmodule import SubModClassDef. Additionally, the from mymodule import * will work as though you specified all sub-modules in __all__ manually.
What’s it do?
set_all_submodules sets up you __all__ variable by auto-detecting the files and sub-modules in the current directory.
bind_all_submodules takes the submodules found in set_all_submodules and applies them to the current namespace.
Release files for allset 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| allset-1.0.1.zip | 5.6 kB | Details |
Release files / allset-1.0.1.zip
| Download URL | allset-1.0.1.zip |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe2d72f4e8ea3c151c399e4953a70acacdfc6c5f502aa756b555196420c0e746
|
|
BLAKE2b-256 checksum How to use checksums |
dccf3236a0dd131e4615e9ef9ff30c2a75a37ae2bc15dfab3562bfe20b1e1311
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |