Issue #16431: Use the type information when constructing a Decimal subtype
from a Decimal argument.
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index ec5db9f..99faf78 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -2047,6 +2047,11 @@
self.assertIs(type(d), MyDecimal)
self.assertEqual(d, d1)
+ a = Decimal('1.0')
+ b = MyDecimal(a)
+ self.assertIs(type(b), MyDecimal)
+ self.assertEqual(a, b)
+
def test_implicit_context(self):
Decimal = self.decimal.Decimal
getcontext = self.decimal.getcontext