]> granicus.if.org Git - python/commitdiff
Update notes on Decimal.
authorRaymond Hettinger <python@rcn.com>
Thu, 14 Feb 2008 01:08:02 +0000 (01:08 +0000)
committerRaymond Hettinger <python@rcn.com>
Thu, 14 Feb 2008 01:08:02 +0000 (01:08 +0000)
Lib/numbers.py

index b8a5c36db941efd7808f6bd8903fb062975d3948..b6de8acf0eb54d05941f4dcf3c1eb3c0d54ab036 100644 (file)
@@ -49,9 +49,11 @@ Inexact.register(float)
 # Inexact.register(decimal.Decimal)
 
 
-## Notes on Decimal and it how relates to the numeric tower
-## --------------------------------------------------------
-## Decimal is Real except that it does not support rich comparisons.
+## Notes on Decimal
+## ----------------
+## Decimal has all of the methods specified by the Real abc, but it should
+## not be registered as a Real because decimals do not interoperate with
+## binary floats.
 ##
 ## Decimal has some of the characteristics of Integrals.  It provides
 ## logical operations but not as operators.  The logical operations only apply
@@ -305,7 +307,6 @@ class Real(Complex):
         return +self
 
 Real.register(float)
-# Real.register(decimal.Decimal)
 
 
 class Rational(Real, Exact):