Fixes #30: Allow usage of lists as paths#34
Merged
Merged
Conversation
akesterson
pushed a commit
that referenced
this pull request
Apr 21, 2015
Fixes #30: Allow usage of lists as paths
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will fix #30 . However, it does raise a new concern.
The implementation as-is will not tell a user who is using string paths that their dictionary contains keys with the separator in them. Because of how the code is laid out, I felt it was too hard to make the validator be aware of whether or not the user had originally passed in a string path or a list path, and therefore I just yanked the key validation entirely. But I don't know that this was the right choice. I'm thinking maybe we should create some path object types, and pass those down to dpath.path.*, so that the low level library can know this information. Something like:
... or something like that. This way the low level lib would know whether or not we should alert the user that their dict has separators in the keys. Of course, this all depends on whether or not we believe we should protect the user. Thoughts?
@calebcase , RFC?