I have a project like that :
foo/
| main.py
| bar/
| | __init__.py
| | module1.py
| | module2.py
And I import module1.py in main.py by import bar.module1.
But I need rewrite bar's function and keep old code. So I change project like that:
foo/
| main.py
| bar/
| | __init__.py
| | oldbar/
| | | module1.py
| | | module2.py
| | | __init__.py
| | newbar/
| | | module1.py
| | | module2.py
| | | __init__.py
Now, I do not want to change main.py, and I still use import bar.module1 in main.py.
Can I do it? add some code into bar/__init__.py?
from subbar import module1? (Be careful mind a cyclic import)