You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -429,18 +429,18 @@ Separator got you down? Use lists as paths
429
429
430
430
The default behavior in dpath is to assume that the path given is a string, which must be tokenized by splitting at the separator to yield a distinct set of path components against which dictionary keys can be individually glob tested. However, this presents a problem when you want to use paths that have a separator in their name; the tokenizer cannot properly understand what you mean by '/a/b/c' if it is possible for '/' to exist as a valid character in a key name.
431
431
432
-
To get around this, you can sidestep the whole "filesystem path" style, and abandon the separator entirely, by using lists as paths. All of the methods in dpath.util.* support the use of a list instead of a string as a path. So for example:
432
+
To get around this, you can sidestep the whole "filesystem path" style, and abandon the separator entirely, by using lists as paths. All of the methods in dpath.* support the use of a list instead of a string as a path. So for example:
433
433
434
434
.. code-block:: python
435
435
436
436
>>> x = { 'a': {'b/c': 0}}
437
-
>>> dpath.util.get(['a', 'b/c'])
437
+
>>> dpath.get(['a', 'b/c'])
438
438
0
439
439
440
440
dpath.segments : The Low-Level Backend
441
441
======================================
442
442
443
-
dpath.util is where you want to spend your time: this library has the friendly
443
+
dpath is where you want to spend your time: this library has the friendly
444
444
functions that will understand simple string globs, afilter functions, etc.
445
445
446
446
dpath.segments is the backend pathing library. It passes around tuples of path
0 commit comments