mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Make Decimal a subclass of Real and Inexact.
This commit is contained in:
parent
968e68dc71
commit
a13f4a1129
3 changed files with 30 additions and 29 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue