Comments (1)
It seems that when pickling the box, only the outer most box is set to box_dots=True for some reason.
from box import Box
import pickle
b2 = Box(
{
"l1": {
"time_range_selected_utc": {
"left": "2023-03-01 10:00:00",
"right": "2023-06-01 10:00:00",
}
},
},
**{'box_dots': True, 'conversion_box': False, 'frozen_box': False}
)
pickle.dump(b2, open("testpickle", "wb"))
loaded = pickle.load(open("testpickle", "rb"))
print(loaded._box_config)
print(loaded["l1"]) # Works
print(loaded["l1"]._box_config)
print(loaded["l1.time_range_selected_utc"]) # Works
print(loaded["l1.time_range_selected_utc"]._box_config)
print(loaded["l1.time_range_selected_utc.left"]) # Breaks
from box.
Related Issues (20)
- Switch to poetry-core HOT 2
- Missing python-box 7.0.0 arm64 wheels HOT 1
- BoxKeyError when constructing a Box with box_dots = True in v7.0.0 HOT 2
- Appending a list to a list causes recursion HOT 4
- IDE Auto Completion for keys
- merge_update() not merging nested dictionaries or lists HOT 1
- path as string HOT 2
- Two test failures due to arguments having incorrect types HOT 3
- __repr__ Does not honor subclasses HOT 1
- Unexpected attributes "size" and "compute" HOT 2
- Feature request: extend `merge_update` into BoxLists HOT 1
- `box_from_file` returns `ruamel.yaml.scalarfloat.ScalarFloat` instead of `float` for floating-point values HOT 1
- Segfault (infinite recursion?) when loading YAML schema into Box with `box_dots=True` HOT 5
- type 'int' is not iterable HOT 1
- Internal-only Variables?
- fozen_box with lists cannot converted to YAML
- Make Box values appear on autocomplete dialog
- default_box_create_on_get=False should still create keys on assigment
- default_box_create_on_get is ignored with from_yaml
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from box.