+ def __hash__(self):
+ return hash(tuple(self.coordinates()))
+
+ def __repr__(self):
+ string = ', '.join(['{!r}: {!r}'.format(symbol, coordinate)
+ for symbol, coordinate in self.coordinates()])
+ return '{}({{{}}})'.format(self.__class__.__name__, string)
+
+ def _map(self, func):
+ for symbol, coordinate in self.coordinates():
+ yield symbol, func(coordinate)
+
+ def _iter2(self, other):
+ if self.symbols != other.symbols:
+ raise ValueError('arguments must belong to the same space')
+ coordinates1 = self._coordinates.values()
+ coordinates2 = other._coordinates.values()
+ yield from zip(self.symbols, coordinates1, coordinates2)
+
+ def _map2(self, other, func):
+ for symbol, coordinate1, coordinate2 in self._iter2(other):
+ yield symbol, func(coordinate1, coordinate2)
+
+
+class Point(Coordinates):
+ """
+ This class represents points in space.
+ """
+
+ def isorigin(self):
+ return not bool(self)
+