mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #16431: Use the type information when constructing a Decimal subtype
from a Decimal argument.
This commit is contained in:
parent
33363f43e3
commit
f4abc7b8a0
3 changed files with 35 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue