Releases: carlosescri/DottedDict
Releases · carlosescri/DottedDict
Better JSON handling.
DottedCollection.load_json()
now expects valid JSON and doesn't mask any error.
Validations when instantiating DottedDict
Now you can't instantiate a dotted collection with an object that contains non-escaped dictionary keys with dots.
Add slicing to dotted
Thanks to @ryanwitt
Can use escaped dots for keys. Bugfixes.
Allow keys with dots Signed-off-by: Carlos Escribano <[email protected]>
Better tests & bugfixes
Special thanks to Marc Abramowitz.
Fixed small bug
When trying to load a leaf value (a string) recursively you got a ValueError
. This release fixes it.
Suppose you have an obj
variable that is an instance of DottedCollection
and a set of config paths and values in a settings collection:
for setting in settings.all():
obj[setting.parameter] = DottedCollection.load_json(setting.value)
That would fail if setting.value
is an instance of basestring
.
But if you do:
obj['source.body'] = DottedCollection.load_json("something")
obj['source.body.more'] = DottedCollection.load_json('{"something": "more"}')
you will get an error because obj['source.body']
is actually an instance of basestring
.