pottery icon indicating copy to clipboard operation
pottery copied to clipboard

Support for Sorted Sets

Open devleaks opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. I'd like easy support through python of Redis SortedSet, very much like like Sets.

>>> from pottery import RedisSortedSet
>>> cars = RedisSortedSet({3: "fast", 2: "faster", 1: "fastest"}, redis=redis, key="cars")
>>> cars.add({4: "slow"})
>>> cars.remove({2: "faster"})
>>> cars
RedisSortedSet({1: "fastest", 3: "fast", 4: "slow"}
>>> fastest = cars.pop()
>>> fastest
{1: "fastest"}

Describe the solution you'd like A mapping between the most appropriate python entity and a Redis Sorted Set, may be a dict of {sorted_criteria: value}?

Describe alternatives you've considered Using Sorted Set directly

Additional context None

devleaks avatar May 22 '22 10:05 devleaks