Make Decimal a subclass of Real and Inexact.

This commit is contained in:
Guido van Rossum 2007-12-10 20:04:04 +00:00
parent 968e68dc71
commit a13f4a1129
3 changed files with 30 additions and 29 deletions

View file

@ -134,6 +134,7 @@ __all__ = [
'setcontext', 'getcontext', 'localcontext'
]
import numbers as _numbers
import copy as _copy
# Rounding
@ -509,7 +510,7 @@ def localcontext(ctx=None):
##### Decimal class #######################################################
class Decimal(object):
class Decimal(_numbers.Real, _numbers.Inexact):
"""Floating point class for decimal arithmetic."""
__slots__ = ('_exp','_int','_sign', '_is_special')