Created
December 27, 2021 06:59
-
-
Save peterjpxie/cd0cf2bc2d7e7a95bdc2ff0c1c36ba04 to your computer and use it in GitHub Desktop.
dotmap_example.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dotmap import DotMap | |
person = { | |
"name": { | |
"firstname": "Peter", | |
"secondname": "Xie" | |
}, | |
"age": 22 | |
}; | |
# assert person["name"]["firstname"] == 'Peter' | |
assert DotMap(person).name.firstname == 'Peter' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment