you should write: if isinstance(self.min_mem, float)  here