[Python-checkins] r80872 - python/trunk/Doc/whatsnew/2.7.rst

Nick Coghlan ncoghlan at gmail.com
Fri May 7 00:08:56 CEST 2010


andrew.kuchling wrote:
> @@ -1238,9 +1247,9 @@
>    expected that the directory or zip contains a :file:`__main__.py`;
>    if it doesn't, some other :file:`__main__.py` might be imported from
>    a location later in ``sys.path``.  This makes some of the machinery
> -  of :mod:`runpy` available to scripts that want to mimic the behaviour
> -  of Python's :option:`-m` switch. (Added by Nick Coghlan;
> -  :issue:`6816`.)
> +  of :mod:`runpy` available to scripts that want to mimic the way
> +  Python's :option:`-m` processes an explicit path name.
> +  (Added by Nick Coghlan; :issue:`6816`.)

Getting closer... despite being in runpy, there's no command line option
involved here, it's just a Python implementation of the path name
processing used by the interpreter command line.

i.e. "python foo" or "python foo.zip" or "python foo.pyc" or python "foo.py"

As with run_module, it *isn't* the exact same code as the interpreter
itself uses, since it can be used for module's other than __main__ (and
doesn't reuse the existing __main__ module).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------


More information about the Python-checkins mailing list