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

Traverse dictionary at a given level #72

Closed
stanleyjs opened this issue Jan 9, 2022 · 1 comment
Closed

Traverse dictionary at a given level #72

stanleyjs opened this issue Jan 9, 2022 · 1 comment
Assignees
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@stanleyjs
Copy link

stanleyjs commented Jan 9, 2022

Hi,

I would like to iterate over all of the keys / items of a given level.

Ideal behavior:

d=benedict()
d['a'][0] = 0
d['a'][1] = 1
d['b'] = 0

print(d.keypaths(level=0))
>>> ['a','b']
print(d.keypaths(level=1))
>>>['a.0','a.1']

And similar functionality for items and other iterators...

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@stanleyjs stanleyjs added the enhancement New feature or request label Jan 9, 2022
@fabiocaccamo fabiocaccamo added sponsored duplicate This issue or pull request already exists and removed sponsored labels Mar 1, 2022
@fabiocaccamo
Copy link
Owner

Duplicate of #49, improving the traverse method a level and max_depth options could be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants