[Python-ideas] PEP for executing a module in a package containing relative imports (original) (raw)
Ron Adam rrr at ronadam.com
Mon Apr 23 01:50:17 CEST 2007
- Previous message: [Python-ideas] PEP for executing a module in a package containing relative imports
- Next message: [Python-ideas] PEP for executing a module in a package containing relative imports
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Jim Jewett wrote:
As long as we're in python-ideas, I'll throw out the radical suggestion of auto-importing sys into builtins, the way os autoimports path.
+1
I thought that this was discussed before and had gotten general approval.
Also it makes sense to me to have additional entries in sys to identify the starting main, and the root package modules. I also like the idea of having a way to say this_module.
if module is sys.main: ...
Notice names aren't used this way, which is generally how you would compare any object in python. You wouldn't try to get it's name and then compare that to the name of another object.
Ron
- Previous message: [Python-ideas] PEP for executing a module in a package containing relative imports
- Next message: [Python-ideas] PEP for executing a module in a package containing relative imports
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]