[Python-3000] PEP to change how the main module is delineated (original) (raw)
Josiah Carlson jcarlson at uci.edu
Mon Apr 23 22:20:46 CEST 2007
- Previous message: [Python-3000] PEP to change how the main module is delineated
- Next message: [Python-3000] PEP to change how the main module is delineated
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Brett Cannon" <brett at python.org> wrote: [snip]
So the questions for people to weigh in on are: [snip] * For ../bacon.py [snip] + Should we walk up the directories until init.py is not found and check for that directory on sys.path? Costly startup, but allows for relative imports to work.
+.99, but should be applied regardless of ../bacon.py, bacon.py, or spam/bacon.py .
Generally, I believe that we should advance up the file system/whatever paths until we run out of init.py . That would give every package, module, etc., a unique name that is the same regardless of whether it is run as bacon.py, ../bacon.py, or spam/bacon.py . I also realize that this idea may not be popular.
If people want a simple inference rule we can ditch main entirely and just go with a simple rule that would be more costly for startup.
Ditch main, at least check for path/init.py when path/bacon.py is run. Whether to advance up the parent paths, and/or how deep to advance up the parent paths I don't know. I know what I want, but I understand that it may not be what others want (especially when confronted with NFS, database imports, etc.).
- Josiah
- Previous message: [Python-3000] PEP to change how the main module is delineated
- Next message: [Python-3000] PEP to change how the main module is delineated
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]