I have a small internal DSL written in one Python file, which has grown to such an extent that I would like to split the contents into several different directories + files.
The new directory structure now looks like this:
dsl/
__init__.py
types/
__init__.py
type1.py
type2.py
and each type file contains a class (e.g. Type1).
My problem is that I would like to keep the implementation of the code that uses this DSL as simple as possible, for example:
import dsl
x = Type1()
...
This means that all important characters must be available directly in the user namespace. I tried updating the top-level file __init__.pyto import the corresponding characters:
from types.type1 import Type1
from types.type2 import Type2
...
print globals()
, , (, import dsl). , , dsl. , ?