Rationale for core Python numeric types

Dan Bishop danb_83 at yahoo.com
Sat Jul 17 03:24:58 EDT 2004


Grant Edwards <grante at visi.com> wrote in message news:<40f85fdf$0$235$a1866201 at newsreader.visi.com>...
...
> > And here's the fixedint.py module I [Dan] 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.]

No, you didn't misunderstand.  It would be a useful feature.  I simply
forgot to consider it.



More information about the Python-list mailing list