Make it easier to extend OrderedDict without breaking it.

This commit is contained in:
Raymond Hettinger 2011-01-01 22:38:00 +00:00
parent 60db46758f
commit 32062e9be7
2 changed files with 10 additions and 2 deletions

View file

@ -52,7 +52,7 @@ class OrderedDict(dict, MutableMapping):
self.__root = root = _proxy(self.__hardroot)
root.prev = root.next = root
self.__map = {}
self.update(*args, **kwds)
self.__update(*args, **kwds)
def __setitem__(self, key, value,
dict_setitem=dict.__setitem__, proxy=_proxy, Link=_Link):
@ -171,7 +171,7 @@ class OrderedDict(dict, MutableMapping):
size += sizeof(self.__root) * n # proxy objects
return size
update = MutableMapping.update
update = __update = MutableMapping.update
pop = MutableMapping.pop
keys = MutableMapping.keys
values = MutableMapping.values