1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#!/usr/bin/env python
__author__ = "Peter Maxwell"
__copyright__ = "Copyright 2007-2009, The Cogent Project"
__credits__ = ["Peter Maxwell"]
__license__ = "GPL"
__version__ = "1.4.1"
__maintainer__ = "Peter Maxwell"
__email__ = "pm67nz@gmail.com"
__status__ = "Production"
class ImmutableDictionary(dict):
def _immutable(self, *args, **kw):
raise TypeError("%ss are immutable" % type(self).__name__)
__setitem__ = __delitem__ = _immutable
update = clear = pop = popitem = setdefault = _immutable
|