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

R. David Murray rdmurray at bitdance.com
Mon Apr 18 14:30:39 CEST 2011


On Mon, 18 Apr 2011 09:36:20 +0100, Paul Moore <p.f.moore at gmail.com> wrote:

On 18 April 2011 08:05, Maciej Fijalkowski <fijall at gmail.com> wrote: > On Sun, Apr 17, 2011 at 4:19 AM, Raymond Hettinger <raymond.hettinger at gmail.com> wrote:

>> The PEP seems to be predicated on a notion that anything written in C is >> bad and that all testing is good. > > Sounds about right I disagree. To me, a Python without libraries such as os, zlib, zipfile, threading, etc wouldn't be much use (except in specialised circumstances). OK, that means that alternative implementations need to do extra work to implement equivalents in their own low-level language, but so be it (sorry!)

I think Maciej left out an "only" in that sentence. If you say "only C", then the sentence makes sense, even when applied to modules that can only be written in C (for CPython). That is, not having a Python version is bad. Necessary in many cases (or not worth the cost, for external library wrappers), but wouldn't it be nicer if it wasn't necessary?

This PEP has a flavour to me of the old "100% pure Java" ideal, where Java coders expected everything to be reimplemented in Java, avoiding any native code. I didn't like the idea then, and I don't have much more love for it now in Python. (OK, I know this is an exaggeration of the position the PEP is taking, but without more clarity in the PEP's language, I honestly don't know how much of an exaggeration).

The Pythonic ideal contains quite a bit of pragmatism, so yes, that is an exaggeration of the goals of the PEP, certainly. (Although pypy may do it anyway, for pragmatic reasons :)

Maybe the PEP could go through the various C libraries in the stdlib at the moment, and discuss how the PEP would address them? It would be useful to see how much of an impact the PEP would have had if it had been Python policy from the start...

That might indeed be a useful exercise, especially since other implementations (or even perhaps CPython developers) may want to contribute Python-only versions and/or tests for things that would have been affected by the PEP. I don't have time to do it right now, but if I can pry any time loose I'll have it near the top of my list.

-- R. David Murray http://www.bitdance.com



More information about the Python-Dev mailing list