[issue30403] Running extension modules using -m switch

Terry J. Reedy report at bugs.python.org
Fri May 19 17:43:52 EDT 2017


Terry J. Reedy added the comment:

What is the use case?

It only make sense to run any stdlib module with -m, and without -i, if it has a command line interface (and an if __name__ clause).  Otherwise, the module is created and then deleted when python exits.

> py -m math
>

C-coded modules with such a command line interface have a mod.py file that imports _mod.

The following can make sense.

> py -m -i math  
Python x.y ...
>>> math.sin(1.48973)

But it is hardly needed as '-m -i math' is only one char less than 'import math'

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30403>
_______________________________________


More information about the Python-bugs-list mailing list