[pypy-dev] Implenting -m command line option

Michael Hudson mwh at python.net
Wed Jul 19 21:59:43 CEST 2006


"Leonardo Soto" <leo.soto at gmail.com> writes:

> Hi all,
>
> I'm new to pypy, and to get myself started I'm trying to fix #145,
> that is, implement the -m flag.
>
> So I did search on the web and python sources looking for what exactly
> -m means, and PEP-338[1] has the better explanation:
>
> "If the module is found, and is of type PY_SOURCE or PY_COMPILED, then
> the command line is effectively reinterpreted from python <options> -m
> <module> <args> to python <options> <filename> <args>. This includes
> setting sys.argv[0] correctly (some scripts rely on this - Python's
> own regrtest.py is one example)."
>
> But, by the way, PEP-338 is about generalizing -m to fully support
> import hooks and executing modules inside packages, including a
> reference implementation almost entirely written as a python module
> (runpy). It has been included recently on CPython 2.5.
>
> So, here is my question:
>
> What "-m behaviour" should be implemented on pypy?

To be honest, either would be great.  The runpy-based solution sounds
easier, so maybe that?

Cheers,
mwh

-- 
41. Some programming languages manage to absorb change, but
    withstand progress.
  -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html




More information about the Pypy-dev mailing list