Skip to content

Instantly share code, notes, and snippets.

@peterjpxie
Created December 27, 2021 06:59
Show Gist options
  • Save peterjpxie/cd0cf2bc2d7e7a95bdc2ff0c1c36ba04 to your computer and use it in GitHub Desktop.
Save peterjpxie/cd0cf2bc2d7e7a95bdc2ff0c1c36ba04 to your computer and use it in GitHub Desktop.
dotmap_example.py
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