Skip to content
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

Nesting ChainTreeMap #1

Open
Naddiseo opened this issue Jun 20, 2018 · 0 comments
Open

Nesting ChainTreeMap #1

Naddiseo opened this issue Jun 20, 2018 · 0 comments

Comments

@Naddiseo
Copy link

Currently the following doesn't work:

    d1 = {'a':1, 'b':2, 'c': {'c1': 1, 'c2': 2}}
    d2 = ChainMapTree({'a':3, 'd':4, 'c': {'c2': 4, 'c3': 3}})
    cm = ChainMapTree(d1, d2)

This can be fixed by changing the __iter__ method to be:

def __iter__(self):
    return itertools.chain.from_iterable(m.keys() for m in self._maps.__iter__())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant