Commit c909b38b authored by Markus Holzer's avatar Markus Holzer
Browse files

Merge branch 'RecursiveDotDict' into 'master'

Recursively convert dictionary in DotDict

See merge request pycodegen/pystencils!162
parents b5418ea3 fdaf4a31
......@@ -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