-
Notifications
You must be signed in to change notification settings - Fork 107
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
Feature Request: add toggle for Default Boxes to not create missing sub-boxes during get requests #164
Comments
That was actually changed in 4.1 IIRC https://github.com/cdgriffith/Box/wiki/Types-of-Boxes This was done to match how
|
Hi, I tried to work with that, but its appears quite problematic in certain cases. Also that has rendered a lot of code based on the old version (<4.1) as buggy. As an example please consider this use case:
Initialization like that, which requires In interactive environment there are several scenarios when not existing field is accessed:
So having the old behavior as option would be quite helpful. |
I'm going to label this a feature request for that like suggested, because using an interpreter interactively is something I want to specifically target with Box's usability, and iPython is probably the best out out there. It is a "medium" size feature request, as thankfully if implemented correctly won't break backwards compatibility, so can be a minor version change. However it is not a simple toggle, as the current process for default boxs resolves around that behavior. Thank you for the suggestion and clearly laying out the problem space! |
__getitem__
creates items?… variable on get request (thanks to ipcoder)
* Adding Cython support to greatly speed up normal Box operations on supported systems * Adding #161 support for access box dots with `get` and checking with `in` (thanks to scott-createplay) * Adding #183 support for all allowed character sets (thanks to Giulio Malventi) * Adding #196 support for sliceable boxes (thanks to Dias) * Adding #164 default_box_create_on_get toggle to disable setting box variable on get request (thanks to ipcoder) * Changing #208 __repr__ to produce `eval`-able text (thanks to Jeff Robbins) * Changing #215 support ruamel.yaml new syntax (thanks to Ivan Pepelnjak) * Changing `update` and `merge_update` to not use a keyword that could cause issues in rare circumstances * Changing internal `_safe_key` logic to be twice as fast * Removing support for ruamel.yaml < 0.17
Box 6 has been released with this added, thanks for opening the issue! |
Hi. I am sorry to be a little late on this topis. There is a common use case of setting up a "deep" field, so let see how it plays out in different configurations. As a special note, lets us take into account a special case interactive environments:
So
Please let me know if I am missing something. As a side note, I believe I understand possible design difficulties to support those scenarios. Thanks again. |
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?
Produces:
Before I could have
default_box
to create items on assignment, but not on reading.For me it seems quite a problematic behavior.
The text was updated successfully, but these errors were encountered: