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

Raymond Hettinger raymond.hettinger at gmail.com
Wed Apr 6 23:27:20 CEST 2011


On Apr 6, 2011, at 1:22 PM, Brett Cannon wrote:

> How about the test suite needs to have 100% test coverage (or as close as possible) on the pure Python version? That will guarantee that the C code which passes that level of test detail is as semantically equivalent as possible. It also allows the other VMs to write their own acceleration code without falling into the same trap as CPython can.

One other thought:  we should probably make a specific exception for pure python code using generators.  It is common for generators to defer argument checking until the next() method is called while the C equivalent makes the check immediately upon instantiation (i.e. map(chr, 3) raises TypeError immediately in C but a pure python generator won't raise until the generator is actually run).


Raymond 


More information about the Python-Dev mailing list