Index: Lib/collections.py =================================================================== --- Lib/collections.py (revision 84821) +++ Lib/collections.py (working copy) @@ -162,6 +162,15 @@ link.next = first root.next = first.prev = link + def __sizeof__(self): + sizeof = _sys.getsizeof + n = len(self) + 1 # number of links including root + size = sizeof(self.__dict__) # instance dictionary + size += sizeof(self.__map) * 2 # internal dict and inherited dict + size += sizeof(self.__hardroot) * n # link objects + size += sizeof(self.__root) * n # proxy objects + return size + setdefault = MutableMapping.setdefault update = MutableMapping.update pop = MutableMapping.pop