How to traverse a sorted set in Redis in reverse order using zscan?
Scanning the Sorted Set with an iterator does not guarantee any order. Use ZREVRANGEBYSCORE for that.
I have a sorted set in Redis with priorities starting from 0 up to 3. I would like to traverse this sorted set from highest to lowest priority using the python iterator zscan_iter. However, using zscan_iter gives me the items starting from 0. Is there a way to reverse the order? Unfortunately, reverse() only works on iterators and not on python generators.
I see two solutions:

Use negative priorities (so instead of 3 use -3)
Paginate through slices of keys using ZREVRANGEBYSCORE, however I would prefer to use an iterator.

Are there any other ways of doing this?