cdgriffith / cdgriffith/Box

[Bug] Camel killer box and box dots gives unexpected behaviour

Open
#300 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.8k
Forks
135
PR merge metrics
No merged PRs in 30d

Description

Hello! Thank you for this awesome package. The combination of camel killer box and box dots does exactly what I'm looking for. Well, almost - there's a couple of behaviours that are not working quite as I expected. I'm not sure how many of these are bugs or just my expectations are wrong but hopefully you can explain!

```
from box import Box

b = Box({"someKey": ["a"]}, camel_killer_box=True, box_dots=True)
b["some_key"]
# works as expected: BoxList(['a'])

b["some_key[0]"]
# works as expected: 'a'

b["someKey"]
# works but I don't know if it should? From the docs it sounds like the original camel-case
# version should have been destroyed completely, but this gives BoxList(['a'])

b["someKey[0]"]
# raises BoxKeyError - not sure whether this should work, but given that just "someKey" worked above
# it feels inconsistent at any rate

b["SomeKey"]
# works but I wouldn't expect it to! Is this meant to work?
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.