From 1d6b2c6b60223f0d5fb6cf3563f3415921ad40b9 Mon Sep 17 00:00:00 2001 From: Pavel Koneski Date: Sun, 6 Mar 2022 16:00:04 -0800 Subject: [PATCH] Revert workarounds in StdLib for Issue #52 (#1333) --- Src/StdLib/Lib/numbers.py | 1 - Src/StdLib/Lib/pickle.py | 1 - Src/StdLib/Lib/test/test_long.py | 15 +++------------ 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Src/StdLib/Lib/numbers.py b/Src/StdLib/Lib/numbers.py index cc40e3150..7eedc63ec 100644 --- a/Src/StdLib/Lib/numbers.py +++ b/Src/StdLib/Lib/numbers.py @@ -387,4 +387,3 @@ def denominator(self): return 1 Integral.register(int) -Integral.register(type(1 << 63)) # https://github.com/IronLanguages/ironpython3/issues/52 diff --git a/Src/StdLib/Lib/pickle.py b/Src/StdLib/Lib/pickle.py index b1d61db9e..3b139844c 100644 --- a/Src/StdLib/Lib/pickle.py +++ b/Src/StdLib/Lib/pickle.py @@ -669,7 +669,6 @@ def save_long(self, obj): return self.write(LONG + repr(obj).encode("ascii") + b'L\n') dispatch[int] = save_long - dispatch[type(1 << 63)] = save_long # https://github.com/IronLanguages/ironpython3/issues/52 def save_float(self, obj): if self.bin: diff --git a/Src/StdLib/Lib/test/test_long.py b/Src/StdLib/Lib/test/test_long.py index aec8c6158..d0de4ac0b 100644 --- a/Src/StdLib/Lib/test/test_long.py +++ b/Src/StdLib/Lib/test/test_long.py @@ -949,10 +949,7 @@ def test_round(self): got = round(10**k + 324678, -3) expect = 10**k + 325000 self.assertEqual(got, expect) - if sys.implementation.name == "ironpython": # https://github.com/IronLanguages/ironpython3/issues/52 - self.assertTrue(isinstance(got, int)) - else: - self.assertIs(type(got), int) + self.assertIs(type(got), int) # nonnegative second argument: round(x, n) should just return x for n in range(5): @@ -960,10 +957,7 @@ def test_round(self): x = random.randrange(-10000, 10000) got = round(x, n) self.assertEqual(got, x) - if sys.implementation.name == "ironpython": # https://github.com/IronLanguages/ironpython3/issues/52 - self.assertTrue(isinstance(got, int)) - else: - self.assertIs(type(got), int) + self.assertIs(type(got), int) for huge_n in 2**31-1, 2**31, 2**63-1, 2**63, 2**100, 10**100: self.assertEqual(round(8979323, huge_n), 8979323) @@ -972,10 +966,7 @@ def test_round(self): x = random.randrange(-10000, 10000) got = round(x) self.assertEqual(got, x) - if sys.implementation.name == "ironpython": # https://github.com/IronLanguages/ironpython3/issues/52 - self.assertTrue(isinstance(got, int)) - else: - self.assertIs(type(got), int) + self.assertIs(type(got), int) # bad second argument bad_exponents = ('brian', 2.0, 0j)