Skip to content

Assigning benedict element to itself clears the element #294

@cdoolin

Description

@cdoolin

Python version
3.11.10

Package version
0.30.0

Current behavior (bug description)

d = benedict({
    "a": {
        "b": 23
    }
})
print(d)
# {'a': {'b': 23}} 

d.a = d.a
print(d)
# {'a': {}}

Expected behavior
Assigning d.a = d.a should not change the dictionary. I would expect the following:

d = benedict({
    "a": {
        "b": 23
    }
})
print(d)
# {'a': {'b': 23}} 

d.a = d.a
print(d)
# {'a': {'b': 23}} 

Cheers

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions