summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_decimal.py
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-11-07 22:12:25 (GMT)
committerStefan Krah <skrah@bytereef.org>2012-11-07 22:12:25 (GMT)
commitf4abc7b8a016da5b1783f471f2f376d7e9c27d60 (patch)
treec4b211cbec57136a5fd25b019fd10008e630b6cf /Lib/test/test_decimal.py
parent33363f43e34defa17ad958ad6d718328f9e78db8 (diff)
downloadcpython-f4abc7b8a016da5b1783f471f2f376d7e9c27d60.zip
cpython-f4abc7b8a016da5b1783f471f2f376d7e9c27d60.tar.gz
cpython-f4abc7b8a016da5b1783f471f2f376d7e9c27d60.tar.bz2
Issue #16431: Use the type information when constructing a Decimal subtype
from a Decimal argument.
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r--Lib/test/test_decimal.py5
1 files changed, 5 insertions, 0 deletions
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 @@ class UsabilityTest(unittest.TestCase):
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