diff options
author | Andrew Nester <andrew.nester.dev@gmail.com> | 2017-02-14 18:22:55 (GMT) |
---|---|---|
committer | Mark Dickinson <mdickinson@enthought.com> | 2017-02-14 18:22:55 (GMT) |
commit | 6d1dece06d13a7d40637e07b2c79f34aab368766 (patch) | |
tree | 3ca2a345299134cb312b3f6fbd9962e8e8dcdbb7 /Lib/test/test_decimal.py | |
parent | c33ee85b6fbed7f9c68e9fd39cd0582af9237ef1 (diff) | |
download | cpython-6d1dece06d13a7d40637e07b2c79f34aab368766.zip cpython-6d1dece06d13a7d40637e07b2c79f34aab368766.tar.gz cpython-6d1dece06d13a7d40637e07b2c79f34aab368766.tar.bz2 |
Fixed #29534 - _decimal difference with _pydecimal (#65)
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r-- | Lib/test/test_decimal.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 59a17af..48360d1 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -1185,6 +1185,16 @@ class FormatTest(unittest.TestCase): self.assertEqual(format(Decimal('100000000.123'), 'n'), '100\u066c000\u066c000\u066b123') + def test_decimal_from_float_argument_type(self): + class A(self.decimal.Decimal): + def __init__(self, a): + self.a_type = type(a) + a = A.from_float(42.5) + self.assertEqual(self.decimal.Decimal, a.a_type) + + a = A.from_float(42) + self.assertEqual(self.decimal.Decimal, a.a_type) + class CFormatTest(FormatTest): decimal = C class PyFormatTest(FormatTest): |