libb.emptydict
- class emptydict[source]
Bases:
attrdictA dictionary that returns None for non-existing keys without raising exceptions.
Similar to attrdict but returns None instead of raising KeyError or AttributeError when accessing non-existing keys.
Basic Usage:
>>> a = emptydict(a=1, b=2) >>> a.c == None True >>> a.b 2 >>> a['b'] 2 >>> 'c' in a False >>> 'b' in a True >>> a.get('b') 2 >>> a.get('c')