MCPcopy Index your code
hub / github.com/RustPython/RustPython / countOf

Function countOf

Lib/operator.py:165–171  ·  view source on GitHub ↗

Return the number of items in a which are, or which equal, b.

(a, b)

Source from the content-addressed store, hash-verified

163 return b in a
164
165def countOf(a, b):
166 "Return the number of items in a which are, or which equal, b."
167 count = 0
168 for i in a:
169 if i is b or i == b:
170 count += 1
171 return count
172
173def delitem(a, b):
174 "Same as del a[b]."

Callers 1

test_countOfMethod · 0.90

Calls

no outgoing calls

Tested by 1

test_countOfMethod · 0.72