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

Stefan Krah stefan at bytereef.org
Sun Apr 17 13:18:48 CEST 2011


R. David Murray <rdmurray at bitdance.com> wrote:
> > The PEP seems to be predicated on a notion that anything written in C is bad and
> > that all testing is good.  AFAICT, it doesn't provide any practical advice to
> > someone pursuing a non-trivial project (such as decimal or threading).  The PEP
> 
> Decimal already has a Python implementation with a very comprehensive
> test suite (no, I don't know if it has 100% coverage).  My understanding
> is that Stefan's code passes the Python test suite.  So I'm not sure
> what the issue is, there.  Stefan?

test_decimal.py does not have 100% coverage yet. cdecimal passes the tests,
but several decimal.py functions would have to perform type checking to
get identical exception behavior.

The current version of the joint unit tests is here:

http://hg.python.org/features/cdecimal/file/b00f8fa70126/Lib/test/decimal_tests.py


cdecimal specific behavior is guarded by HAVE_CDECIMAL, so it is
possible to grep for the differences.



As an aside, test_decimal.py constitutes at most 1% of the total tests.
The important tests (mathematical correctness and conformance to the
specification) are in two separate test suites, one of which runs
tests against decimal.py and the other against decNumber. These tests
can easily take a week to run, so they can't be part of the regression
tests.


Stefan Krah




More information about the Python-Dev mailing list