Revision 3720
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/dicts.py | ||
---|---|---|
8 | 8 |
class DictProxy(UserDict.DictMixin): |
9 | 9 |
'''A proxy that forwards all accesses to an inner dict.''' |
10 | 10 |
|
11 |
def __init__(self, inner={}): self.inner = inner |
|
11 |
def __init__(self, inner=None): |
|
12 |
if inner == None: inner = {} |
|
13 |
self.inner = inner |
|
12 | 14 |
|
13 | 15 |
def keys(self): return self.inner.keys() |
14 | 16 |
|
Also available in: Unified diff
dicts.py: DictProxy: Fixed bug where default value for inner param needed to be created in the constructor, or else every default instance would use and modify the same dictionary