Box
Box copied to clipboard
box_dots notation support for get() and set()
from box import Box
box = Box({"logging": {"level": "INFO", "structured": True}}, box_dots=True)
assert box.logging.level == "INFO"
assert box["logging.level"] == "INFO"
assert box.get("logging.level") == "INFO"
assert box.get("logging.level", None) == "INFO"
The last two asserts fail. I think it would make sense to support the notation in the get and set methods as well.
@cdgriffith Someone is working on the issue? otherwise I can take a look.
Looks like someone tried to do something about it a long time ago, but I never got around to actually working on it or testing it https://github.com/cdgriffith/Box/tree/bugfix/dots_get
Please feel free to work on it @myusko!
Just noticed this was still open, is actually a dup of https://github.com/cdgriffith/Box/issues/161 and was added in 6.0!