FixedPoint

Tim Peters tim.one at home.com
Thu Feb 7 22:21:06 EST 2002


[Mark McEahern]
> In the FixedPoint module found here:
>
>
<ftp://ftp.python.org/pub/python/contrib-09-Dec-1999/DataStructures/FixedPoi
nt.py.Z>
>
> there seems to be a bug comparing to None like this:
>
>   if f == None:
> ...
>     TypeError: can't convert to FixedPoint: None

Magnitude (as opposed to identity -- "is") comparision of a FixedPoint to a
non-numeric object makes no sense that I'm comfortable imposing, so I'm
happy to let it raise an exception.  Specific apps may require more, and
through the magic of subclassing you can supply whatever senseless <wink>
comparison behavior you like without touching the base code.

In any case, this isn't a maintained module.  Whatever time I may have been
able to devote to it I set aside in case Aahz hits snags implementing IBM's
Standard Decimal Arithmetic proposal:

    http://www2.hursley.ibm.com/decimal/

FixedPoint gets the job done for most who've tried it, but it's at odds with
IBM's proposed model, and I like IBM's well enough that I'd rather help it
become a standard.





More information about the Python-list mailing list