MCPcopy
hub / github.com/celery/celery / zadd

Method zadd

t/unit/backends/test_redis.py:141–148  ·  view source on GitHub ↗
(self, key, mapping)

Source from the content-addressed store, hash-verified

139 return self.keyspace.setdefault(key, list())
140
141 def zadd(self, key, mapping):
142 # Store elements as 2-tuples with the score first so we can sort it
143 # once the new items have been inserted
144 fake_sorted_set = self._get_sorted_set(key)
145 fake_sorted_set.extend(
146 (score, value) for value, score in mapping.items()
147 )
148 fake_sorted_set.sort()
149
150 def zrange(self, key, start, stop):
151 # `stop` is inclusive in Redis so we use `stop + 1` unless that would

Calls 3

_get_sorted_setMethod · 0.95
extendMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected