Skip to content

delete() take in a list of keys #608

@woozyking

Description

@woozyking

The use case came up when I tried to do this:

# conn is a valid StrictRedis instance
keys = conn.keys('namespace:*')  # this returns a list
conn.delete(keys)  # does not delete all the keys in the list

conn.delete(*keys)  # raises ResponseError: wrong number of arguments for 'del' command

# edit: conn.delete(*keys) works when the list is not empty

Can we make it a bit neater to allow delete to just accept a list or a set of strings (keys) to do the necessary check to be passed to execute_command('DEL', ...)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions