X-Git-Url: https://scm.cri.mines-paristech.fr/git/linpy.git/blobdiff_plain/2964ba35929f34ab12a6ee61ad7cc3fb543da875..663316ddc03c19cf06e95bad67fd5ac2bb5e1dfc:/pypol/coordinates.py diff --git a/pypol/coordinates.py b/pypol/coordinates.py index 44b9e9d..78e8d4a 100644 --- a/pypol/coordinates.py +++ b/pypol/coordinates.py @@ -3,7 +3,7 @@ import numbers import operator from abc import ABC, abstractmethod -from collections import OrderedDict +from collections import OrderedDict, Mapping from .linexprs import Symbol @@ -75,7 +75,7 @@ class Point(Coordinates): """ def __new__(cls, coordinates=None): - if isinstance(coordinates, dict): + if isinstance(coordinates, Mapping): coordinates = coordinates.items() self = object().__new__(cls) self._coordinates = OrderedDict() @@ -227,8 +227,3 @@ class Vector(Coordinates): coordinates = self._map2(other, operator.sub) return other.__class__(coordinates) return NotImplemented - - def __repr__(self): - string = ', '.join(['{!r}: {!r}'.format(symbol, coordinate) - for symbol, coordinate in self.coordinates()]) - return '{}({{{}}})'.format(self.__class__.__name__, string)