Storage dict features. #1680
Replies: 2 comments
-
I don't quite understand the advantage. If, e.g., x = app.storage.general.count instead of x = app.storage.general.get('count', 0) But is it so much better? Personally I'm not 100% sure if I like the implicitness of addict. You never know if something is really the value or just the default value because a key is missing. |
Beta Was this translation helpful? Give feedback.
-
For me the attribute by name feature is interesting but not that useful. What I do find useful is the ability to make deeply nested dicts without extra verbosity. It might not be that great of a feature but I prefer the look of the addict syntax. normal_dict = {'a': {'b': {'c': {'d': {'e': 'f'}}}}}
addict['a']['b']['c']['d']['e'] = 'f' |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Utilizing standard dict for highly nested arbitrary data can really get really complicated. Has there been any thought to integrating any functionality similar to libraries like https://github.com/mewwts/addict ?
To be more specific I don't mean the attribute access just the defaulting/arbitrary feature. Maybe utilizing 'defaultdict'?
Beta Was this translation helpful? Give feedback.
All reactions