Explicitly mention accelerator modules can be a subset of functionality.

This commit is contained in:
Brett Cannon 2011-04-06 10:05:50 -07:00
parent e68bd8b5ae
commit cfb1d26c38
1 changed files with 16 additions and 14 deletions

View File

@ -14,12 +14,13 @@ Abstract
======== ========
The Python standard library under CPython contains various instances The Python standard library under CPython contains various instances
of modules implemented in both pure Python and C. This PEP requires of modules implemented in both pure Python and C (either entirely or
that in these instances that both the Python and C code *must* be partially). This PEP requires that in these instances that both the
semantically identical (except in cases where implementation details Python and C code *must* be semantically identical (except in cases
of a VM prevents it entirely). It is also required that new C-based where implementation details of a VM prevents it entirely). It is also
modules lacking a pure Python equivalent implementation get special required that new C-based modules lacking a pure Python equivalent
permissions to be added to the standard library. implementation get special permissions to be added to the standard
library.
Rationale Rationale
@ -33,14 +34,15 @@ areas where CPython cannot be used, e.g., Jython allowing Python to be
used in Java applications. used in Java applications.
A problem all of the VMs other than CPython face is handling modules A problem all of the VMs other than CPython face is handling modules
from the standard library that are implemented in C. Since they do not from the standard library that are implemented (to some extent) in C.
typically support the entire `C API of Python`_ they are unable to use Since they do not typically support the entire `C API of Python`_ they
the code used to create the module. Often times this leads these other are unable to use the code used to create the module. Often times this
VMs to either re-implement the modules in pure Python or in the leads these other VMs to either re-implement the modules in pure
programming language used to implement the VM (e.g., in C# for Python or in the programming language used to implement the VM
IronPython). This duplication of effort between CPython, PyPy, Jython, (e.g., in C# for IronPython). This duplication of effort between
and IronPython is extremely unfortunate as implementing a module *at CPython, PyPy, Jython, and IronPython is extremely unfortunate as
least* in pure Python would help mitigate this duplicate effort. implementing a module *at least* in pure Python would help mitigate
this duplicate effort.
The purpose of this PEP is to minimize this duplicate effort by The purpose of this PEP is to minimize this duplicate effort by
mandating that all new modules added to Python's standard library mandating that all new modules added to Python's standard library