Skip to content

Commit

Permalink
address reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Jan 24, 2025
1 parent 75f7833 commit 11dd047
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Doc/library/decimal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,8 @@ function to temporarily change the active context.
IEEE interchange formats. The argument must be a multiple of 32 and less
than :const:`IEEE_CONTEXT_MAX_BITS`.

.. versionadded:: 3.14

New contexts can also be created using the :class:`Context` constructor
described below. In addition, the module provides three pre-made contexts:

Expand Down
6 changes: 3 additions & 3 deletions Lib/test/test_decimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4417,15 +4417,15 @@ def assert_rest(self, context):
assert_rest(self, c)

# Invalid values
self.assertRaises(OverflowError, IEEEContext, 2**63)
self.assertRaises(OverflowError, IEEEContext, sys.maxsize + 1)
self.assertRaises(ValueError, IEEEContext, -1)
self.assertRaises(ValueError, IEEEContext, 123)
self.assertRaises(ValueError, IEEEContext, 1024)

def test_constants(self):
# IEEEContext
IEEE_CONTEXT_MAX_BITS = self.decimal.IEEE_CONTEXT_MAX_BITS
if IEEE_CONTEXT_MAX_BITS != 256:
self.assertEqual(IEEE_CONTEXT_MAX_BITS, 512)
self.assertIn(IEEE_CONTEXT_MAX_BITS, {256, 512})

@requires_cdecimal
class CIEEEContexts(IEEEContexts, unittest.TestCase):
Expand Down

0 comments on commit 11dd047

Please sign in to comment.