[Python-Dev] PEP 399: Pure Python/C Accelerator Module Compatibiilty Requirements

R. David Murray rdmurray at bitdance.com
Tue Apr 19 16:50:28 CEST 2011


On Tue, 19 Apr 2011 12:01:44 +0200, Stefan Behnel <stefan_ml at behnel.de> wrote:
> A related question is: when other Python VM projects try to port a given C 
> module, would they actually invest the time to write a pure Python version 
> that may or may not run within acceptable performance bounds for them, or 
> would they prefer saving time by writing only a native implementation 
> directly for their VM for performance reasons? Maybe both, maybe not. If 
> they end up writing a native version after prototyping in Python, is the 
> prototype worth including in the shared stdlib, even if its performance is 
> completely unacceptable for everyone? Or, if they write a partial module 
> and implement another part of it natively, would the incomplete 
> implementation qualify as a valid addition to the shared stdlib?

I would say yes, it is worth including.  And even more worth including is
any additional tests they develop to validate their implementation.

> Implementing a 100% compatible and "fast enough" Python version of a module 
> is actually a rather time consuming task. I think we are expecting some 
> altruism here that is easily sacrificed for time constraints, in any of the 
> Python VM projects. CPython is just in the unlucky position of representing 
> the status-quo.

Well, I don't think we are really expecting altruism.  We're trying
to leverage the work the community is doing, by drawing as much of the
Python code and validation tests that get created into a common stdlib.

If a module in the wild is being considered for inclusion in the stdlib,
it will need to have a Python version if practical.  Since we accept
so few modules anyway (for good reason), I really don't see this as a
big deal.  And, there's always the practicality beats purity argument:
if the PEP turns out to really get in the way of something everyone wants,
then we can agree to an exception.

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


More information about the Python-Dev mailing list