If we don't want specs with certan names be able to override system packages, importing must be done a bit different. In the first place, in the way not modyfying sys.modules. And I'd like it not to touch disk at all. In kaitaiStructCompile there is an impl not touching disk, but it has problems with reloading (in fact it was pretty hard to debug even loading, I had to implement a tool called FrozenTable.py (patching python binary/shared library executable because import machinery bytecode is hardcoded into binary) to do that).
If we don't want specs with certan names be able to override system packages, importing must be done a bit different. In the first place, in the way not modyfying
sys.modules
. And I'd like it not to touch disk at all. In kaitaiStructCompile there is an impl not touching disk, but it has problems with reloading (in fact it was pretty hard to debug even loading, I had to implement a tool called FrozenTable.py (patching python binary/shared library executable because import machinery bytecode is hardcoded into binary) to do that).