[issue30403] Running extension modules using -m switch

2017-05-30 Thread Petr Viktorin
Petr Viktorin added the comment: This is now waiting to be added to the PEPs repo: https://github.com/python/peps/pull/266 -- ___ Python tracker ___

[issue30403] Running extension modules using -m switch

2017-05-25 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for bringing me in. The PoC implementation looks nice. Whether I'd like to support this in Cython? Absolutely. Requires some work, though, since Cython still doesn't implement PEP 489. But it shouldn't be hard, if I remember the discussions from back

[issue30403] Running extension modules using -m switch

2017-05-25 Thread Petr Viktorin
Petr Viktorin added the comment: Adding Stefan from the Cython project. Stefan, is this something you'd want to use? (It does require PEP 489 multi-phase initialization, so I assume it would need extra #ifdefs in Cythonized code for Python 3.5+ or 3.7+) -- nosy: +scoder

[issue30403] Running extension modules using -m switch

2017-05-25 Thread Nick Coghlan
Nick Coghlan added the comment: I just marked the associated PR as "[PEP required]", as while I'm in favour of merging this, I think we should go through the PEP process first: 1. We've been burned before by not properly advertising changes to Python's command line behaviour (while zip

[issue30403] Running extension modules using -m switch

2017-05-23 Thread Marcel Plch
Changes by Marcel Plch : -- pull_requests: +1845 ___ Python tracker ___ ___

[issue30403] Running extension modules using -m switch

2017-05-20 Thread Nick Coghlan
Nick Coghlan added the comment: Yep, that's the kind of thing we'd like to make possible. -- ___ Python tracker ___

[issue30403] Running extension modules using -m switch

2017-05-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: So a use case might be that someone could compile all the stdlib .py modules with cython, as they are, without touching the code, and have the result be a drop-in replacement. I'd like that to be possible. -- ___

[issue30403] Running extension modules using -m switch

2017-05-20 Thread Nick Coghlan
Nick Coghlan added the comment: As a high level overview of the general idea: we'd like it to be almost entirely transparent to the end user as to whether a particular module is implemented as normal Python source code, a precompiled bytecode/wordcode file, or a precompiled Cython extension

[issue30403] Running extension modules using -m switch

2017-05-19 Thread Petr Viktorin
Petr Viktorin added the comment: It's part of a larger effort to bring the capabilities of extension modules up to par with Python ones. For example, it's one less surprise you'd get when you Cythonize a module. And it's not only for stdlib modules – it's for any extension module. I'd be

[issue30403] Running extension modules using -m switch

2017-05-19 Thread Terry J. Reedy
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

[issue30403] Running extension modules using -m switch

2017-05-19 Thread Petr Viktorin
Changes by Petr Viktorin : -- nosy: +encukou, ncoghlan ___ Python tracker ___ ___

[issue30403] Running extension modules using -m switch

2017-05-19 Thread Marcel Plch
New submission from Marcel Plch: Currently the -m switch does not work with extension modules: $ python3 -m math /usr/bin/python3: No code object available for math In order to enable extension modules to behave like Python source modules, the -m switch should be supported.