Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephan Seitz
pystencils
Commits
fdaf4a31
Commit
fdaf4a31
authored
Jun 24, 2020
by
Stephan Seitz
Browse files
Recursively convert dictionary in DotDict
parent
b44b0045
Pipeline
#24665
passed with stage
in 9 minutes and 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pystencils/utils.py
View file @
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment