Skip to content

add `.assign()`

Pre-release
Pre-release
Compare
Choose a tag to compare
@Kilo59 Kilo59 released this 12 Jun 18:37
· 6 commits to master since this release
d6bc03b

Add a .assign(path, val, missing = None) convenience method.
Can now use the missing callable to backfill missing data structures.

>>> from glom_dict import GlomDict
>>> my_dict = GlomDict()
>>> my_dict.assign('a.b.c', 'hi', missing=dict)
{'a': {'b': {'c': 'hi'}}}