[Python-Dev] Re: Decimal data type issues (original) (raw)

Aahz aahz at pythoncraft.com
Sat Apr 17 10:07:13 EDT 2004


[That'll teach me to respond before reading a thread. ;-) ]

On Fri, Apr 16, 2004, Kevin Jacobs wrote:

Python decimals would do well to support the creation of instances with fixed scale and precision parameters, since this information will be what is provided by databases, other financial and engineering applications, and schema. i.e., these parameters override the natural scale and precision found in the literal values used when constructing decimals. e.g., hypothetically: Decimal('2.4000', precision=2, scale=1) == Decimal('2.4') Decimal('2.4', precision=5, scale=4) == Decimal('2.4000')

I'd say it makes more sense for someone else to implement these features as helper functions or classes. They're not directly part of the Decimal system. Facundo got roped into this because he wanted a Money class and was persuaded to do the finishing work for getting Decimal into Python as the basis. Seems to me this is in the same category of building some additional capabilities on top of Decimal.

Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/

"I used to have a .sig but I found it impossible to please everyone..." --SFJ



More information about the Python-Dev mailing list