bpo-44558: Make the implementation consistency of operator.indexOf (GH-27012)

(cherry picked from commit 09302405d2)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
This commit is contained in:
Miss Islington (bot) 2021-07-05 02:52:04 -07:00 committed by GitHub
parent fe847a6285
commit 9f47d872db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -184,6 +184,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