File size: 326 Bytes
633ff21 18d41ce 7bf2069 18d41ce 7bf2069 18d41ce 56f9ca5 a13e45d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
"""Module containing the DictDefault class"""
from addict import Dict
class DictDefault(Dict):
"""
A Dict that returns None instead of returning empty Dict for missing keys.
"""
def __missing__(self, key):
return None
def __or__(self, other):
return DictDefault(super().__or__(other))
|