[Python-Dev] PEP for adding a decimal type to Python

Michael McLay mclay@nist.gov
Thu, 26 Jul 2001 17:38:27 -0400


On Thursday 26 July 2001 04:52 pm, Tim Peters wrote:
> >     [1] ANSI standard X3.274-1996.
> >         (See http://www2.hursley.ibm.com/decimal/deccode.html)
>
> Michael, this is merely a standard for *encoding* decimal numbers; it
> doesn't say anything about semantics, or exceptions, or anything else
> visible to users.

This was a proposal for a mechanism for mingling types safely.  It was not
intended as a definition of how decimal numbers should be implemented.  My
implementation tests the interaction of the current number types with the
decimal type and I only completed enought of the decimal type implementation
to support this testing.  I was not expecting to discuss how decimal types
should work.  That has been discussed already. I was primarily interested in
testing the effects of adding a new number type as I described in the PEP.

What did you think of the idea of adding a new command and file format?

> Are you aware that Aahz is implementing "the real" spec for Python, a level
> up at
>
>     http://www2.hursley.ibm.com/decimal/
>
> under "Base specification"?  There are so few people working on the decimal
> idea that I hate to see it fragmented already.

Yes I have played with the Decimal.py module. I developed decimalobject.c so
I could test the inpact of introducing an additional command and file format
to Python.  I expect this code to be replaced.  As I said in the PEP I also
think the decimal number implementation will evolve into a type that supports
inheritance.