summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_operator.py
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na@python.org>2021-07-05 09:04:36 (GMT)
committerGitHub <noreply@github.com>2021-07-05 09:04:36 (GMT)
commit09302405d22e86884d6058226790c0cdf5b72f14 (patch)
tree43ce4c9cd74961e9b0aaf2452fb610967056661d /Lib/test/test_operator.py
parentabb08e3af6aa19928007a349592e95e6de38467f (diff)
downloadcpython-09302405d22e86884d6058226790c0cdf5b72f14.zip
cpython-09302405d22e86884d6058226790c0cdf5b72f14.tar.gz
cpython-09302405d22e86884d6058226790c0cdf5b72f14.tar.bz2
bpo-44558: Make the implementation consistency of operator.indexOf (GH-27012)
Diffstat (limited to 'Lib/test/test_operator.py')
-rw-r--r--Lib/test/test_operator.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py
index 1ecae85..d50306b 100644
--- a/Lib/test/test_operator.py
+++ b/Lib/test/test_operator.py
@@ -188,6 +188,9 @@ class OperatorTestCase:
self.assertRaises(ZeroDivisionError, operator.indexOf, BadIterable(), 1)
self.assertEqual(operator.indexOf([4, 3, 2, 1], 3), 1)
self.assertRaises(ValueError, operator.indexOf, [4, 3, 2, 1], 0)
+ nan = float("nan")
+ self.assertEqual(operator.indexOf([nan, nan, 21], nan), 0)
+ self.assertEqual(operator.indexOf([{}, 1, {}, 2], {}), 0)
def test_invert(self):
operator = self.module