[pypy-dev] Implenting -m command line option

Leonardo Soto leo.soto at gmail.com
Wed Jul 19 19:23:07 CEST 2006

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?

Leonardo Soto M.

[1] http://www.python.org/dev/peps/pep-0338/

More information about the Pypy-dev mailing list