MCPcopy
hub / github.com/redis/redis-py / remove

Method remove

redis/data_structure.py:32–39  ·  view source on GitHub ↗

Remove first occurrence of item

(self, item)

Source from the content-addressed store, hash-verified

30 self._items.insert(left, (item, weight))
31
32 def remove(self, item):
33 """Remove first occurrence of item"""
34 with self._lock:
35 for i, (stored_item, weight) in enumerate(self._items):
36 if stored_item == item:
37 self._items.pop(i)
38 return weight
39 raise ValueError("Item not found")
40
41 def get_by_weight_range(
42 self, min_weight: float, max_weight: float

Calls

no outgoing calls