[Python-ideas] Decimal literal?
clp at rebertia.com
Thu Dec 4 19:18:24 CET 2008
On Thu, Dec 4, 2008 at 10:04 AM, Terry Reedy <tjreedy at udel.edu> wrote:
> Chris Rebert wrote:
>> 3. (in Python 4.0/Python 4000) making decimal the default instead of
>> float, with floats instead requiring a 'f' suffix
> Decimal is not just a decimal arithmetic module. It implements and will
> track a particular complex, specialized, possibly changeable standard
> controlled by IBM, which already has a few crazy quirks present for
> commercial rather than technical reasons. This is fine for an add-on class
> but not, in my opinion, for Python's default fraction arithmetic. If
> Python's developers did consider replacing floats in that role, I would
> prefer either fractions or a much simplified decimal type designed by us for
> general purpose needs.
I'll just point out that GvR seemed to favor the general idea (along
with a transition mechanism) in the old thread I mentioned in my
original post; otherwise I'd have been much more wary of including #3.
I can't speak to how good the standard is comparatively except that
the Python devs must have chosen it over others or a custom one for
good reason, and at least it's better than plain floats. The PEP
mentions it being almost completely ANSI/IEEE-compliant and that it
has already taken into account the evil corner cases.
Follow the path of the Iguana...
> Terry Jan Reedy
> Python-ideas mailing list
> Python-ideas at python.org
More information about the Python-ideas