Skip to content

Feature request: support for multiple parameters to delete() #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adamcharnock opened this issue Dec 29, 2009 · 2 comments
Closed

Comments

@adamcharnock
Copy link

The DEL supports multiple parameters, can redis-py also support this?

I expect it could be done as follows:

def delete(self, *args):
    """
    >>> r = Redis(db=9)
    >>> r.delete('dsjhfksjdhfkdsjfh')
    0
    >>> r.set('a', 'a')
    'OK'
    >>> r.delete('a')
    1
    >>> r.exists('a')
    0
    >>> r.delete('a')
    0
    >>> 
    """
    return self.send_command('DEL %s\r\n' % " ".join(args))

Thank you!

@adamcharnock
Copy link
Author

I have implemented this in a fork, here:
http://github.com/adamcharnock/redis-py

@andymccurdy
Copy link
Contributor

This has been pushed to master. Thanks!

bellatoris pushed a commit to bellatoris/redis-py that referenced this issue Jul 13, 2023
…s raised an exception (redis#3)

* [GROW-3134] release already acquired connections, when get_connections raised an exception

* fix style

(cherry picked from commit 94bb915)
uglide added a commit that referenced this issue Oct 15, 2024
uglide added a commit that referenced this issue Oct 18, 2024
uglide added a commit that referenced this issue Oct 18, 2024
This reverts commit 46d618f.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants