Commit 28069cf4 authored by alexeib's avatar alexeib Committed by Myle Ott
Browse files

fix issue with truncated dict

parent cfd2a3a0
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -203,9 +203,9 @@ class Dictionary(object):
class TruncatedDictionary(object):

    def __init__(self, wrapped_dict, length):
        self.__class__ = type(dict.__class__.__name__,
                              (self.__class__, dict.__class__), {})
        self.__dict__ = dict.__dict__
        self.__class__ = type(wrapped_dict.__class__.__name__,
                              (self.__class__, wrapped_dict.__class__), {})
        self.__dict__ = wrapped_dict.__dict__
        self.wrapped_dict = wrapped_dict
        self.length = min(len(self.wrapped_dict), length)