|
|
|
|
|
by robochat
1795 days ago
|
|
Relative imports used to work much more naturally IMHO in python2 but then they broke it in python3 because Guido wanted scripts and modules to always be separate codebases. So, whereas it used to be easy to have a module that could also be run as a script inside a package, this is now very difficult to implement. To the extent that any python2 code that does this, should probably be refactored when being ported to python3. |
|
I want to organize my code logically in directories. As a script grows, I want the ability to spin out parts of that file to separate files.
In order to do that in python, I need separate directories between the script and the spun-out functionality. This ends with a script that says "do function from module" and all code being in the module.
Having code in different directories for no reason except "the import system" sucks. How is this supposed to go?