Skip to content

iterating benedict_dictionary.items(), value is not benedict_type  #333

@Loreton

Description

@Loreton

Python version
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux

Package version
python-benedict 0.32.0

Current behavior (bug description)

from benedict import benedict

likes = {
        "fruit": {
            "apple": "green", 
            "banana": "yellow",
            "raspberry": "red",
            }
        }


likes=benedict(likes, keyattr_enabled=True, keyattr_dynamic=False)

for k, v in likes.items():  
     print(k, type(v))
     print(k, type(likes[k]))

Result

fruit <class 'dict'>
fruit <class 'benedict.dicts.benedict'>

Expected behavior

The item value returned by the for loop is a dict and not a benedict.dict as it should be. This behavior is intentional or is it a bug?

fruit <class 'benedict.dicts.benedict'>
fruit <class 'benedict.dicts.benedict'>

Regards

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