summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAdrian Wielgosik <adrian17@users.noreply.github.com>2017-08-17 12:46:06 (GMT)
committerAntoine Pitrou <pitrou@free.fr>2017-08-17 12:46:06 (GMT)
commit7c17e2304b9387f321c813516bf134e4f0bd332a (patch)
treed98fd606ed73aa51c853576c7b978d6fc0457d1e /Lib
parentee84a608587b930176d37303afae8a4358e15990 (diff)
downloadcpython-7c17e2304b9387f321c813516bf134e4f0bd332a.zip
cpython-7c17e2304b9387f321c813516bf134e4f0bd332a.tar.gz
cpython-7c17e2304b9387f321c813516bf134e4f0bd332a.tar.bz2
bpo-24700: Add a fast path for comparing array.array of equal type (#3009)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_array.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index d67f919..e9218f3 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)