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

default_box_create_on_get=False should still create keys on assigment #274

Open
wrdls opened this issue Jul 4, 2024 · 0 comments
Open

Comments

@wrdls
Copy link

wrdls commented Jul 4, 2024

As reported before in #164 (comment)

The current behavior of default_box_create_on_get is not what you would expect and eliminates a large part what makes default_box useful in the first place.

In the following case I would still expect b.foo.bar to be set to 1.

>>> b = Box(default_box=True, default_box_create_on_get=False)
>>> b.foo.bar
Box({})
>>> b.foo.bar = 1
>>> b.foo.bar
Box({})
>>> b
Box({})

Not sure if this is feasible, but a new config option default_box_create_on_set could be added to control this behavior.

@wrdls wrdls changed the title default_box_create_on_get=False should still create nested keys on assigment default_box_create_on_get=False should still create keys on assigment Jul 4, 2024
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

1 participant