-
Notifications
You must be signed in to change notification settings - Fork 100
Closed
Description
Summary
With hiredis, set operations (such as SMEMBERS
) returns different types between RESP2 and RESP3.
I confirmed the difference was not observed without hiredis.
Versions
Redis(server): 7.4.0
Python: 3.12.4
redis(Python Library): 5.0.8
hiredis(Python Library): 3.0.0
Example
Code:
from redis import Redis
client = Redis(protocol=2)
print("RESP2")
print(type(client.smembers("test-set")))
print(type(client.sunion("test-set")))
print(type(client.sdiff("test-set")))
print(type(client.sinter("test-set")))
client = Redis(protocol=3)
print("RESP3")
print(type(client.smembers("test-set")))
print(type(client.sunion("test-set")))
print(type(client.sdiff("test-set")))
print(type(client.sinter("test-set")))
Output:
RESP2
<class 'set'>
<class 'set'>
<class 'set'>
<class 'set'>
RESP3
<class 'list'>
<class 'list'>
<class 'list'>
<class 'list'>
Metadata
Metadata
Assignees
Labels
No labels