mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
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:
parent
22bcc0768e
commit
1f8486fd50
3 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue