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

Could support to init a list as EasyDict object? #43

Open
wjkV587 opened this issue Nov 21, 2023 · 2 comments
Open

Could support to init a list as EasyDict object? #43

wjkV587 opened this issue Nov 21, 2023 · 2 comments

Comments

@wjkV587
Copy link

wjkV587 commented Nov 21, 2023

I try if dict contain a list, it could be convert to a easydict object and could get the attribute by "key1.key2[0].key3".
but when it starts as a list ,easydict could not working.

@leplatrem
Copy link
Collaborator

Show us your code!

@wjkV587
Copy link
Author

wjkV587 commented Nov 24, 2023

from easydict import EasyDict
s = [{'a':'1',"b":'2'},{'c':"3"}]
format_s = EasyDict(s)
print(format_s)

it will report error 'ValueError: dictionary update sequence element #1 has length 1; 2 is required'

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

2 participants