Add unicode() for Distance: show the distance

This commit is contained in:
Bruno Cauet 2015-01-27 12:16:40 +01:00
parent dbef31776f
commit 154917bbd1

View file

@ -361,6 +361,9 @@ class Distance(object):
def __rsub__(self, other):
return other - self.distance
def __unicode__(self):
return "{0:.2f}".format(self.distance)
# Behave like a dict.
def __getitem__(self, key):