List of all members.
Detailed Description
Definition at line 5 of file frozendict.py.
Constructor & Destructor Documentation
def frozendict::frozendict::__init__ |
( |
|
self, |
|
|
|
args, |
|
|
|
kw |
|
) |
| |
Member Function Documentation
def frozendict::frozendict::__hash__ |
( |
|
self | ) |
|
Definition at line 41 of file frozendict.py.
00042 :
00043 try:
00044 return self._cached_hash
00045 except AttributeError:
00046 h = self._cached_hash = hash(frozenset(self.items()))
00047 return h
def frozendict::frozendict::__new__ |
( |
|
cls, |
|
|
|
args, |
|
|
|
kw |
|
) |
| |
Definition at line 13 of file frozendict.py.
00014 :
00015 new = dict.__new__(cls)
00016
00017 args_ = []
00018 for arg in args:
00019 if isinstance(arg, dict):
00020 arg = copy.copy(arg)
00021 for k, v in arg.items():
00022 if isinstance(v, dict):
00023 arg[k] = frozendict(v)
00024 elif isinstance(v, list):
00025 v_ = list()
00026 for elm in v:
00027 if isinstance(elm, dict):
00028 v_.append( frozendict(elm) )
00029 else:
00030 v_.append( elm )
00031 arg[k] = tuple(v_)
00032 args_.append( arg )
00033 else:
00034 args_.append( arg )
00035
00036 dict.__init__(new, *args_, **kw)
00037 return new
def frozendict::frozendict::__repr__ |
( |
|
self | ) |
|
Definition at line 48 of file frozendict.py.
00049 :
00050 return "frozendict(%s)" % dict.__repr__(self)
00051
def frozendict::frozendict::_blocked_attribute |
( |
|
obj | ) |
[private] |
Definition at line 6 of file frozendict.py.
00007 :
raise AttributeError, "A frozendict cannot be modified."
Member Data Documentation
Property Documentation
frozendict::frozendict::_blocked_attribute = property(_blocked_attribute) [static, private] |