Skip to content

Commit 11dd047

Browse files
committed
address reviews
1 parent 75f7833 commit 11dd047

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Doc/library/decimal.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,8 @@ function to temporarily change the active context.
10351035
IEEE interchange formats. The argument must be a multiple of 32 and less
10361036
than :const:`IEEE_CONTEXT_MAX_BITS`.
10371037

1038+
.. versionadded:: 3.14
1039+
10381040
New contexts can also be created using the :class:`Context` constructor
10391041
described below. In addition, the module provides three pre-made contexts:
10401042

Lib/test/test_decimal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4417,15 +4417,15 @@ def assert_rest(self, context):
44174417
assert_rest(self, c)
44184418

44194419
# Invalid values
4420-
self.assertRaises(OverflowError, IEEEContext, 2**63)
4420+
self.assertRaises(OverflowError, IEEEContext, sys.maxsize + 1)
44214421
self.assertRaises(ValueError, IEEEContext, -1)
4422+
self.assertRaises(ValueError, IEEEContext, 123)
44224423
self.assertRaises(ValueError, IEEEContext, 1024)
44234424

44244425
def test_constants(self):
44254426
# IEEEContext
44264427
IEEE_CONTEXT_MAX_BITS = self.decimal.IEEE_CONTEXT_MAX_BITS
4427-
if IEEE_CONTEXT_MAX_BITS != 256:
4428-
self.assertEqual(IEEE_CONTEXT_MAX_BITS, 512)
4428+
self.assertIn(IEEE_CONTEXT_MAX_BITS, {256, 512})
44294429

44304430
@requires_cdecimal
44314431
class CIEEEContexts(IEEEContexts, unittest.TestCase):

0 commit comments

Comments
 (0)