[Python-ideas] PEP for executing a module in a package containing relative imports (original) (raw)
Christian Heimes lists at cheimes.de
Fri Apr 20 19:32:45 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 ]
Brett Cannon schrieb:
True, but it does introduce an import for a module that may never be used if the module is not being executed. That kind of sucks for minor performance reasons.
Yeah but sys is used by a lot of modules. Probably 95%+ of executable modules are either using sys directly to access sys.argv or os which imports sys. Also sys is a builtin module which is imported ridiculously fast. I assume that the speed penalty for scripts that don't use sys is minor.
In my humble opinion it sucks less to force the import of a core module that is already used by most modules than to bind valuable developer time in the main approach. I think it's a Pythonic solution as well. :)
Christian
- 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 ]