Commit fdaf4a31 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Recursively convert dictionary in DotDict

parent b44b0045
Pipeline #24665 passed with stage
in 9 minutes and 51 seconds
......@@ -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)
......
Markdown is supported
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