summaryrefslogtreecommitdiffstats
path: root/Lib/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/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/operator.py')
-rw-r--r--Lib/operator.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/operator.py b/Lib/operator.py
index fb58851..6782703 100644
--- a/Lib/operator.py
+++ b/Lib/operator.py
@@ -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')