def __repr__(self):
info = [(key, getattr(self, key)) for key in self.__dict__]
info = ["{}={}".format(key, size_repr(item))for key, item in info]
return "{}({})".format(self.__class__.__name__, ", ".join(info))
After Change
self.size = size
def __repr__(self):
info = [size_repr(key, getattr(self, key)) for key in self.__dict__]
return "{}({})".format(self.__class__.__name__, ", ".join(info))