mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
bpo-44558: Make the implementation consistency of operator.indexOf (GH-27012)
This commit is contained in:
parent
abb08e3af6
commit
09302405d2
3 changed files with 6 additions and 1 deletions
|
@ -173,7 +173,7 @@ def getitem(a, b):
|
|||
def indexOf(a, b):
|
||||
"Return the first index of b in a."
|
||||
for i, j in enumerate(a):
|
||||
if j == b:
|
||||
if j is b or j == b:
|
||||
return i
|
||||
else:
|
||||
raise ValueError('sequence.index(x): x not in sequence')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue