Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Work with non-iterable dictionaries. #127

Open

Description

The way dpath.util.get is implemented means that it requires all parts of the tree to be iterable. So if you have a node which is a dictionary, but isn't iterable, it does not allow you to find the children under that node. This is a consequence of using fold and walk to implement get. This is also not efficient if the node is a map (that is, it still iterates over the keys when it could do a direct lookup).

To make get more efficient and also allow non-iterable maps we need use kvs only when the related segment is a glob (that is, only iterate over them if it is strictly necessary). This means we can't use fold or walk anymore. There probably is additional fallout in the other methods like view and search. Unfortunately this will require some significant changes.

Originally reported here:
https://github.com/akesterson/dpath-python/pull/122/files#diff-f50eb92b27ecc897863ec0f0ef4f0f65R52-R66

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /