projects
/
linpy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
45951a9
)
Remove duplicate methods in coordinates.py
author
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Fri, 11 Jul 2014 14:19:09 +0000
(16:19 +0200)
committer
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Fri, 11 Jul 2014 14:19:15 +0000
(16:19 +0200)
pypol/coordinates.py
patch
|
blob
|
history
diff --git
a/pypol/coordinates.py
b/pypol/coordinates.py
index
9e46673
..
44b9e9d
100644
(file)
--- a/
pypol/coordinates.py
+++ b/
pypol/coordinates.py
@@
-133,30
+133,9
@@
class Vector(Coordinates):
self._coordinates = terminal._map2(initial, operator.sub)
return self
self._coordinates = terminal._map2(initial, operator.sub)
return self
- @property
- def symbols(self):
- return tuple(self._coordinates)
-
- @property
- def dimension(self):
- return len(self.symbols)
-
- def coordinates(self):
- yield from self._coordinates.items()
-
- def coordinate(self, symbol):
- if not isinstance(symbol, Symbol):
- raise TypeError('symbol must be a Symbol instance')
- return self._coordinates[symbol]
-
- __getitem__ = coordinate
-
def isnull(self):
return not bool(self)
def isnull(self):
return not bool(self)
- def __bool__(self):
- return any(self._coordinates.values())
-
def __add__(self, other):
if isinstance(other, (Point, Vector)):
coordinates = self._map2(other, operator.add)
def __add__(self, other):
if isinstance(other, (Point, Vector)):
coordinates = self._map2(other, operator.add)