Skip to content
Snippets Groups Projects
Commit fdaf4a31 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Recursively convert dictionary in DotDict

parent b44b0045
Branches
Tags
1 merge request!162Recursively convert dictionary in DotDict
......@@ -14,6 +14,13 @@ class DotDict(dict):
__setattr__ = dict.__setitem__
__delattr__ = dict.__delitem__
# Recursively make DotDict: https://stackoverflow.com/questions/13520421/recursive-dotdict
def __init__(self, dct={}):
for key, value in dct.items():
if isinstance(value, dict):
value = DotDict(value)
self[key] = value
def all_equal(iterator):
iterator = iter(iterator)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment