Skip to content

delete_if_exists method? strike? #1

@JohnAD

Description

@JohnAD

It would be nice if a 'delete_if_exists' method were available. so instead of:

if r.has('something', 'blah'):
    del r['something', 'blah']

I could simply do:

r.delete_if_exists('something', 'blah')

If could return True if a deletion actually happened. False otherwise.

Or it could return None to make documentation more fluid.

It would be limited to deleting a single entry.

Ooo.. even better. Call the method 'strike' to give it a single lexicon word.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions