It's when self.nnz != self.size (i.e. when there are zeros that are not in self.data) that you need to do more.