根据https://redis-py.readthedocs.org/en/latest/的官方文档
最佳答案当您在参数列表中看到语法*值时,表示该函数采用可变数量的参数.
因此,称之为
r.sadd('a', 1, 2, 3)
您可以使用splat运算符传递一个iterable来解压缩它:
r.sadd('a', *set([3,4]))
循序而渐进 厚积而薄发 博观而约取
根据https://redis-py.readthedocs.org/en/latest/的官方文档
最佳答案当您在参数列表中看到语法*值时,表示该函数采用可变数量的参数.
因此,称之为
r.sadd('a', 1, 2, 3)
您可以使用splat运算符传递一个iterable来解压缩它:
r.sadd('a', *set([3,4]))