> from decimal import Decimal > > In [21]: a = Decimal() > > In [22]: class Decimal(object): > ....: pass > ....: > > In [23]: b = Decimal() > > In [24]: a - b
Perhaps I don't understand what you are doing here, but on line 22 you overload Decimal. If you just have a = Decimal() b = Decimal() print a-b yields 0. decimal.Decimal() can be subtracted from decimal.Decimal(). decimal.Decimal() can not be subtracted from class Decimal(object). I would assume that they are different types. Using the original code, print type(a), type(b). -- http://mail.python.org/mailman/listinfo/python-list