-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Dot String to Access DotMap Paths #57
Comments
Also setting a dictionary value will not work. ie. you cannot do this: x = blah.blah.blah it would translate to: {"x": "test") and not: {"blah": {"blah": {"blah": "test"}}} |
I don't use Python enough anymore to justify the amount of effort it would take me to implement this. Almost all of my personal development is in Go now. You are welcome to create a PR that adds the feature and doesn't break the unit tests (or appropriately modifies them) and adds a flag to disable it with |
@drgrib it wouldn't be that hard IMO (but very useful). Something like this should do:
The hard part would be to be able to rewrite |
This should be doable with something like this: https://vinta.ws/code/dot-notation-obj-x-y-z-for-nested-objects-and-dictionaries-in-python.html |
I know this is a years-late reply, but
|
I have a piece of software that outputs dictionary mapping in dot notation. I was hoping to be able to assign the dot notation to a variable and pass it to a DotMap for a lookup but that does not seem possible.
I would expect that code to print "1". Just noting this down here as a nice to have given that it looks like that is what #27 was also looking for.
https://github.com/cdgriffith/Box#box-dots actually looks to have that functionality.
The text was updated successfully, but these errors were encountered: