MCPcopy Create free account
hub / github.com/grantjenks/python-sortedcontainers / find

Method find

tests/sortedcollection.py:167–172  ·  view source on GitHub ↗

Return first item with a key == k. Raise ValueError if not found.

(self, k)

Source from the content-addressed store, hash-verified

165 del self._items[i]
166
167 def find(self, k):
168 'Return first item with a key == k. Raise ValueError if not found.'
169 i = bisect_left(self._keys, k)
170 if i != len(self) and self._keys[i] == k:
171 return self._items[i]
172 raise ValueError('No item found with key equal to: %r' % (k,))
173
174 def find_le(self, k):
175 'Return last item with a key <= k. Raise ValueError if not found.'

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected