[Python-Dev] Should standard library modules optimize for CPython? (original) (raw)

Stefan Behnel stefan_ml at behnel.de
Mon Jun 2 12:32:36 CEST 2014


Maciej Fijalkowski, 02.06.2014 10:48:

On Mon, Jun 2, 2014 at 10:43 AM, Victor Stinner wrote:

2014-06-01 10:11 GMT+02:00 Steven D'Aprano <steve at pearwood.info>:

My feeling is that the CPython standard library should be written for CPython,

Right. PyPy, Jython and IronPython already have their "own" standard library when they need a different implement. PyPy: "libpypy" directory (lib-python is the CPython stdlib): https://bitbucket.org/pypy/pypy/src/ac52eb7bbbb059d0b8d001a2103774917cf7396f/libpypy/?at=default it's for stuff that's in CPython implemented in C, not a reimplementation of python stuff. we patched the most obvious CPython-specific hacks, but it's a loosing battle, you guys will go way out of your way to squeeze extra 2% by doing very obscure hacks.

Thus my proposal to compile the modules in CPython with Cython, rather than duplicating their code or making/keeping them CPython specific. I think reducing the urge to reimplement something in C is a good thing.

Stefan



More information about the Python-Dev mailing list