'-m' option (was RE: [Python-Dev] ConfigParser patches)
ncoghlan at email.com
Mon Oct 4 23:51:08 CEST 2004
Quoting Paramjit Oberoi <psoberoi at gmail.com>:
> With a slightly longer script, and a little work in the installer,
> these could be written as:
> Installed: runpy.py profile demo.py
> Prompt After: runpy.py -i profile demo.py
> Alt install: runpy2.4.py profile demo.py
> Build dir: ./runpy.py profile demo.py
> - or - ./scripts/runpy.py profile demo.py
Indeed, it may be possible to get those to *run*, but the problem is that the
semantics of the following two commands are likely to differ:
python <interpreter-options> runpy.py module <script-args>
python runpy.py <interpreter-options> module <script-args
And getting the semantics close enough that the remaining differences don't
matter is likely to be a pain. Certainly, you won't be able to use execfile()
any more, because it doesn't support passing compiler flags.
And the script doesn't have to get much more complicated before it becomes
_harder_ to understand and maintain than the C code required to implement '-m'
(which is really pretty straightforward when it is limited to top-level modules).
More information about the Python-Dev