redis.sadd("myset", "one", "two", "three")

assert redis.spop("myset") in {"one", "two", "three"}

Arguments

key
str
required

The key of the set.

count
int

How many members to remove and return.

Response

The popped member. If count is specified, a set of members is returned.

redis.sadd("myset", "one", "two", "three")

assert redis.spop("myset") in {"one", "two", "three"}