Treat None values as unexisting keys for default_box
See original GitHub issueHi,
thanks a lot for your project, it’s currently helping me a lot 😃 one feature i missed is the ability to treat None values as if there was no key defined.
like in this example.
b=Box({'brol': None}, default_box=True)
b.brol.truc
gives
Traceback (most recent call last): File “<stdin>”, line 1, in <module> AttributeError: ‘NoneType’ object has no attribute ‘truc’
but this works as exepected
b=Box({}, default_box=True)
b.brol.truc
many many thanks 👍
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Proper way to remove keys in dictionary with None values in ...
Iterating over dict is always unsafe if you are going to be mutating the dictionary in the process. Iterating over dict.keys() and dict.items() ......
Read more >Setting keys to None · Issue #190 · redis/redis-py - GitHub
Redis treats everything as a string. It has no concept of Null values. Even when fetching a key that doesn't exist, a sane...
Read more >Python | Check for None values in given dictionary
In this, we check for all the values using all function extracted using values function. The not operator is used to inverse the...
Read more >Java Map Introduction
A map stores key/value pairs, where each key has an associated value. Given a particular key, ... If the key is not present...
Read more >Null in Python: Understanding Python's NoneType Object
Python uses the keyword None to define null objects and variables. ... Here, None is the default value for the key parameter as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Added in 4.0
Hello @cdgriffith, if you are open to contributions, can I submit a PR for this issue ?