mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
bpo-46361: Fix "small" int
caching (GH-30583)
This commit is contained in:
parent
09087b8519
commit
5cd9a162cd
5 changed files with 24 additions and 1 deletions
|
@ -2552,6 +2552,13 @@ class PythonAPItests(unittest.TestCase):
|
|||
self.assertRaises(OverflowError, int, Decimal('inf'))
|
||||
self.assertRaises(OverflowError, int, Decimal('-inf'))
|
||||
|
||||
@cpython_only
|
||||
def test_small_ints(self):
|
||||
Decimal = self.decimal.Decimal
|
||||
# bpo-46361
|
||||
for x in range(-5, 257):
|
||||
self.assertIs(int(Decimal(x)), x)
|
||||
|
||||
def test_trunc(self):
|
||||
Decimal = self.decimal.Decimal
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue