Skip to content

Feature Request: add toggle for Default Boxes to not create missing sub-boxes during get requests #164

@ipcoder

Description

@ipcoder

Hi
I know there were significant changes in 5+, so I could have missed that, but I thought
reading from not existing item does not creates it.

So, my question is, if the code below works as intended?

import box
print(box.__version__)

b = box.Box(default_box=True)
print(b)
print(b.z)
print(b)

Produces:

5.1.0
{}
{}
{'z': {}}

Before I could have default_box to create items on assignment, but not on reading.
For me it seems quite a problematic behavior.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions