Rationale for core Python numeric types

Grant Edwards grante at visi.com
Sat Jul 17 01:08:16 CEST 2004

On 2004-07-16, Dan Bishop <danb_83 at yahoo.com> wrote:
> "Batista, Facundo" <FBatista at uniFON.com.ar> wrote in message news:<mailman.481.1089982235.5135.python-list at python.org>...
>> [mfein2 at earthlink.net]
>> #- rationale for core Python numeric types? Should I just go 
>> #- dunk my head
>> #- in a pail of water and take a deep breath?
>> No. You should write a PEP.
>> If gets accepted, and you or somebody implements it,
> Not necessarily in that order :-)


> And here's the fixedint.py module I just wrote:

Very cool. 

I'm going to play with it a bit next week.  After a quick read,
one suggestion would be to allow operations between fixedint
types and "normal" python integers by coercing the "normal"
value to the fixedint type.

Assuming that "a" is a fixedint type it might be awfully handy
to be able to do things like 

 a += 1
 a &= 7 
 b = a ^ 1

rather than having to create fixedint versions of literal
constants. [I may have misunderstood the code and this is not
an issue.]
Grant Edwards                   grante             Yow!  Yow!! That's a GOOD
                                  at               IDEA!! Eating a whole FIELD
                               visi.com            of COUGH MEDICINE should
                                                   make you feel MUCH BETTER!!

More information about the Python-list mailing list