-
Notifications
You must be signed in to change notification settings - Fork 14
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
Improving consistency in usage of redis-dict #52
Comments
Hi @Attumm Do let me know if this is something of interest |
Hi snk96, Currently, life is getting in the way of writing the response your message deserves. Thanks for reaching out. Your message made my day. You found the exact point at which I left to ponder the problem but never returned to it. Let me outline the background story of the chain_ methods. foo["a"]["b"] = 2 The question that was left open was: "Should redis-dict support nested dictionary calls?" redis-dict uses Redis as a key-value store. Thus, each operation will be atomic and independent, and each client can use redis-dict to connect to large servers.
I would agree with that statement. Personally, I'm a fan of using unit tests to describe the functionality we would like to see. The configurable delimiters is great idea, and having new methods that would expand on it could work. It would help if we had more examples. We could write them as unit tests. Example Let's use them to outline the ideas and behaviours, of the code. |
Hi @Attumm
Lovely project. I am building atop it to have a slightly modified version. If you're open to it, I think it would be good to have these features integrated back upstream. Listing the points (in no particular order) below, please do let me know if you'd be open to contributions for the same:
.chain_set()
. This is non-intuitive, and ideally the user shouldn't have to worry about this.a["var"]={"c":1, "c2":3}
, it should internally created nested keys that are managed by redis (and hence updatable) using.chain_set()
internally.a["var"]["c"] = 2
, it should raise aNotImplementedError
that asks users to instead use.chain_set()
instead. (proposing this approach because of a limitation in python's language parser that doesn't allow it to uniquely identify if a nested setitem is being run, or a simple setitem. For more, can refer here)chain_xyz()
set of functions,:
is used as a separator. However, this isn't a very scalable choice, as:
could appear in the individual keys of the hierarchy too. Hence, this should be configurable. Additionally, the default should perhaps be a non-ASCII character like '➡️'The text was updated successfully, but these errors were encountered: