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

Method find_le

tests/sortedcollection.py:174–179  ·  view source on GitHub ↗

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

(self, k)

Source from the content-addressed store, hash-verified

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.'
176 i = bisect_right(self._keys, k)
177 if i:
178 return self._items[i-1]
179 raise ValueError('No item found with key at or below: %r' % (k,))
180
181 def find_lt(self, k):
182 'Return last item with a key < k. Raise ValueError if not found.'

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected