We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
confirm_overwrite
wrap_kvs
A preset function you can use in wrap_kvs to ask the user to confirm if they're writing a value in a key that already has a different value under it.
from dol import wrap_kvs d = {'a': 'apple', 'b': 'banana'} d = wrap_kvs(d, preset=confirm_overwrite) d['a'] = 'apple' d['c'] = 'coconut' assert d == {'a': 'apple', 'b': 'banana', 'c': 'coconut'}
But
d['a'] = 'alligator'
would lead to a user input request:
The key a already exists and has value apple. If you want to overwrite it with alligator, confirm by typing alligator here:
which would only perform the write if the user types alligator and hits return
alligator
┆Issue is synchronized with this Asana task by Unito
The text was updated successfully, but these errors were encountered:
feat: confirm_overwrite (#13)
af21bae
No branches or pull requests
A preset function you can use in wrap_kvs to ask the user to confirm if they're writing a value in a key that already has a different value under it.
But
would lead to a user input request:
which would only perform the write if the user types
alligator
and hits return┆Issue is synchronized with this Asana task by Unito
The text was updated successfully, but these errors were encountered: