[Python-Dev] Adding decimal (aka FixedPoint) numbers to Python

Brett Cannon brett@python.org
Sun, 15 Dec 2002 14:32:17 -0800 (PST)


[Michael McLay]

> On Sunday 15 December 2002 04:00 am, Brett Cannon wrote:
> > [Michael McLay]
> >
> > Someone will correct me if I am wrong, but making a new decimal type that
> > includes a new suffix for numbers is  going to require a PEP.  Your
> > email, though, already seems like a rather good start for one and should
> > not require much more work.
>
> Yes, there should be a PEP. I posted this as a work in progress because I had
> a question on the semantics and also to get a general sense of what questions
> a PEP might need to answer.
> >

OK.  But please do a PEP.  PEPs do not need to have  all the answers to
all questions.  You an have a "Considerations" section where you list
these questions with the pros and cons of possible decisions.  It will
also help to get more people to read it (i.e., people other than
python-dev).

> > It would be easier to get the module itself sans any Python core changes
> > accepted initially to gauge usage and interest by the Python community
> > before pushing for syntax integration.  This is what is be done with the
> > current rational implementation.
>
> The module has existed for quite some time and is available on sourceforge at
> <http://fixedpoint.sourceforge.net/>. I made some changes to the module and I
> am interested in opinions on the change in the name of the class.
>

It is still going to take someone to champion the module to get BDFL
pronouncment from Guido autonomously or get enough people to rally behind
to put pressure on Guido to let it in.

What  I would like to know is if Tim ever pushed to get the module in, and
if not, why?  Since he is the original author I assume he felt some reason
to write it (although it quite easily be "I was bored" <wink>) and yet
didn't feel like trying to get it into the stdlib.

>
> The syntax change is primarily to make Python more appealing to professions
> that require the semantics of fixed point decimal numbers.

I understand that, but who knows how many of those types  of  users are
out  there (current and potentiol).  Going so far as to integrate it into
Python requires proof that there is a demand.  Just saying it will help
make Python appealling to one specific group is not enough.  If  it was
Python would be diluted  with a ton of ideas that appeal to only a
specific group.

> compatibllity. In order to add decimal numbers as an alternative the syntax
> must distinguish floats from decimal. The format I proposed is already used
> to distinguish number types is used for complex and long numbers.
>

Understood and if  it is decided  to add decimals as a built-in I  think
the way you have  proposed works very well.

My advice is to champion getting the module into the language.  As of
right now that is  the key getting anything  to move forward.

-Brett