class documentation
class FreezableDefaultDict(collections.defaultdict): (source)
Often it is desirable to prevent the mutation of a default dict after its initial construction, such as to prevent mutation during iteration. >>> dd = FreezableDefaultDict(list) >>> dd[0].append('1') >>> dd.freeze() >>> dd[1] [] >>> len(dd) 1
Method | __missing__ |
Undocumented |
Method | freeze |
Undocumented |
Instance Variable | _frozen |
Undocumented |