From 7c17e2304b9387f321c813516bf134e4f0bd332a Mon Sep 17 00:00:00 2001 From: Adrian Wielgosik Date: Thu, 17 Aug 2017 12:46:06 +0000 Subject: bpo-24700: Add a fast path for comparing array.array of equal type (#3009) --- Lib/test/test_array.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Lib/test/test_array.py') diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index d67f9195eb..e9218f3dd6 100644 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -1342,6 +1342,16 @@ class FPTest(NumberTest): def assertEntryEqual(self, entry1, entry2): self.assertAlmostEqual(entry1, entry2) + def test_nan(self): + a = array.array(self.typecode, [float('nan')]) + b = array.array(self.typecode, [float('nan')]) + self.assertIs(a != b, True) + self.assertIs(a == b, False) + self.assertIs(a > b, False) + self.assertIs(a >= b, False) + self.assertIs(a < b, False) + self.assertIs(a <= b, False) + def test_byteswap(self): a = array.array(self.typecode, self.example) self.assertRaises(TypeError, a.byteswap, 42) -- cgit v1.2.1