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

[suggestion] Better .get method #31

Open
athossampayo opened this issue Sep 25, 2021 · 0 comments
Open

[suggestion] Better .get method #31

athossampayo opened this issue Sep 25, 2021 · 0 comments

Comments

@athossampayo
Copy link

So, this is a simple suggestion, that I'm willing to contribute if more people believe it will be a good improvement:
We should be able to access sub-elements on a Easydict with the method .get() from dict. Now this is the current behavior:

> dic = EasyDict({"first":{"second":{"third":"value"}}})
> dic.first.second.get("third")
'value'
> dic.first.get("second.third")
None

I beleive the correct behavior should be something in this line:

> dic.first.get("second.third")
'value'

Any ideas or comments on this idea?

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