Author: raymond.hettinger
Date: Wed Feb  6 01:15:42 2008
New Revision: 60611

Removed:
   python/branches/py3k/Lib/UserDict.py
Modified:
   python/branches/py3k/Misc/NEWS
Log:
Remove the old UserDict module.

Deleted: /python/branches/py3k/Lib/UserDict.py
==============================================================================
--- /python/branches/py3k/Lib/UserDict.py       Wed Feb  6 01:15:42 2008
+++ (empty file)
@@ -1,81 +0,0 @@
-"""A more or less complete user-defined wrapper around dictionary objects."""
-
-class UserDict:
-    def __init__(self, dict=None, **kwargs):
-        self.data = {}
-        if dict is not None:
-            self.update(dict)
-        if len(kwargs):
-            self.update(kwargs)
-    def __repr__(self): return repr(self.data)
-    def __eq__(self, dict):
-        if isinstance(dict, UserDict):
-            return self.data == dict.data
-        else:
-            return self.data == dict
-    def __ne__(self, dict):
-        if isinstance(dict, UserDict):
-            return self.data != dict.data
-        else:
-            return self.data != dict
-    def __len__(self): return len(self.data)
-    def __getitem__(self, key):
-        if key in self.data:
-            return self.data[key]
-        if hasattr(self.__class__, "__missing__"):
-            return self.__class__.__missing__(self, key)
-        raise KeyError(key)
-    def __setitem__(self, key, item): self.data[key] = item
-    def __delitem__(self, key): del self.data[key]
-    def clear(self): self.data.clear()
-    def copy(self):
-        if self.__class__ is UserDict:
-            return UserDict(self.data.copy())
-        import copy
-        data = self.data
-        try:
-            self.data = {}
-            c = copy.copy(self)
-        finally:
-            self.data = data
-        c.update(self)
-        return c
-    def keys(self): return self.data.keys()
-    def items(self): return self.data.items()
-    def values(self): return self.data.values()
-    def update(self, dict=None, **kwargs):
-        if dict is None:
-            pass
-        elif isinstance(dict, UserDict):
-            self.data.update(dict.data)
-        elif isinstance(dict, type({})) or not hasattr(dict, 'items'):
-            self.data.update(dict)
-        else:
-            for k, v in dict.items():
-                self[k] = v
-        if len(kwargs):
-            self.data.update(kwargs)
-    def get(self, key, failobj=None):
-        if key not in self:
-            return failobj
-        return self[key]
-    def setdefault(self, key, failobj=None):
-        if key not in self:
-            self[key] = failobj
-        return self[key]
-    def pop(self, key, *args):
-        return self.data.pop(key, *args)
-    def popitem(self):
-        return self.data.popitem()
-    def __contains__(self, key):
-        return key in self.data
-    @classmethod
-    def fromkeys(cls, iterable, value=None):
-        d = cls()
-        for key in iterable:
-            d[key] = value
-        return d
-
-class IterableUserDict(UserDict):
-    def __iter__(self):
-        return iter(self.data)

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS      (original)
+++ python/branches/py3k/Misc/NEWS      Wed Feb  6 01:15:42 2008
@@ -75,7 +75,7 @@
 
 - Created new UserDict class in collections module.  This one inherits from and
   complies with the MutableMapping ABC.  
-  XXX still need to covert old UserDict based tests and eliminate the old 
UserDict module.
+  XXX still need to move docs
 
 - Removed UserDict.DictMixin.  Replaced all its uses with 
collections.MutableMapping.
 
_______________________________________________
Python-3000-checkins mailing list
Python-3000-checkins@python.org
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to