Register decimals as numbers.Number
diff --git a/Lib/decimal.py b/Lib/decimal.py
index 661d6ed..3ad80b3 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -135,6 +135,7 @@
]
import copy as _copy
+import numbers as _numbers
try:
from collections import namedtuple as _namedtuple
@@ -3567,6 +3568,12 @@
return self
+# Register Decimal as a kind of Number (an abstract base class).
+# However, do not register it as Real (because Decimals are not
+# interoperable with floats).
+_numbers.Number.register(Decimal)
+
+
##### Context class #######################################################