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
No related branches found
No related tags found
No related merge requests found
Pipeline #24665 passed
......@@ -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% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment