def repr_part(self): """Return a string usable in a space's ``__repr__`` method.""" if self.matrix_issparse: part = 'weighting={}'.format(self.matrix) else: part = 'weighting={}'.format(arraynd_repr(self.matrix, nprint=10)) if self.exponent != 2.0: part += ', exponent={}'.format(self.exponent) if self.dist_using_inner: part += ', dist_using_inner=True' return part
def __repr__(self): """Return ``repr(self)``.""" return '{!r}.element({})'.format(self.space, arraynd_repr(self.asarray()))