MCPcopy Index your code
hub / github.com/python/cpython / indexOf

Function indexOf

Lib/operator.py:181–187  ·  view source on GitHub ↗

Return the first index of b in a.

(a, b)

Source from the content-addressed store, hash-verified

179 return a[b]
180
181def indexOf(a, b):
182 "Return the first index of b in a."
183 for i, j in enumerate(a):
184 if j is b or j == b:
185 return i
186 else:
187 raise ValueError('sequence.index(x): x not in sequence')
188
189def setitem(a, b, c):
190 "Same as a[b] = c."

Callers 1

test_indexOfMethod · 0.90

Calls 1

enumerateFunction · 0.85

Tested by 1

test_indexOfMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…