[Python-Dev] PEP 399: Pure Python/C Accelerator Module Compatibiilty Requirements (original) (raw)

Stefan Behnel stefan_ml at behnel.de
Tue Apr 5 10:26:45 CEST 2011


Brett Cannon, 05.04.2011 01:46:

At both the VM and language summits at PyCon this year, the issue of compatibility of the stdlib amongst the various VMs came up. Two issues came about in regards to modules that use C code. One is that code that comes in only as C code sucks for all other VMs that are not CPython since they all end up having to re-implement that module themselves. Two is that modules that have an accelerator module (e.g., heapq, warnings, etc.) can end up with compatibility options (sorry, Raymond, for picking on heapq, but is was what bit the PyPy people most recently =).

In lieu of all of this, here is a draft PEP to more clearly state the policy for the stdlib when it comes to C code. Since this has come up before and this was discussed so much at the summits I have gone ahead and checked this in so that even if this PEP gets rejected there can be a written record as to why. And before anyone asks, I have already run this past the lead devs of PyPy, Jython, and IronPython and they all support what this PEP proposes.

We recently had the discussion about reimplementing stdlib C modules in Cython. Accelerator modules are the obvious first step here, as they could be implemented in Python and compiled with Cython, instead of actually writing them in C in the first place. Wouldn't this be worth mentioning in the PEP?

Stefan



More information about the Python-Dev mailing list