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

Method remove

tests/sortedcollection.py:161–165  ·  view source on GitHub ↗

Remove first occurence of item. Raise ValueError if not found

(self, item)

Source from the content-addressed store, hash-verified

159 self._items.insert(i, item)
160
161 def remove(self, item):
162 'Remove first occurence of item. Raise ValueError if not found'
163 i = self.index(item)
164 del self._keys[i]
165 del self._items[i]
166
167 def find(self, k):
168 'Return first item with a key == k. Raise ValueError if not found.'

Callers 8

discardMethod · 0.95
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
stress_removeFunction · 0.45
stress_removeFunction · 0.45
stress_removeFunction · 0.45

Calls 1

indexMethod · 0.95

Tested by 3

stress_removeFunction · 0.36
stress_removeFunction · 0.36
stress_removeFunction · 0.36