Skip to content

get doesn't work when the key is a list with one element. #5

@mathiasrabe

Description

@mathiasrabe

Python version
3.7.4

Package version
0.14.0

Current behavior (bug description)
I tried the following:

from benedict import benedict

key = ['1', '2']
dictionary = {'1' : {'2' : 'two'}}
d = benedict(dictionary)
print(d.get(key))

key = ['1']
dictionary = {'1' : 'one'}
d = benedict(dictionary)
print(d.get(key))

'two' will be printed but 'one' not. I get an type error: TypeError: unhashable type: 'list'

Expected behavior
I expected that the last command will print 'one'.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions