From ffbff4046faef7d731857b585be727cbcd3ca64a Mon Sep 17 00:00:00 2001 From: Stephan Rave Date: Mon, 13 Feb 2017 21:52:49 +0100 Subject: [PATCH] [vectorarrays] make NumpyVectorSpace hashable --- src/pymor/vectorarrays/numpy.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pymor/vectorarrays/numpy.py b/src/pymor/vectorarrays/numpy.py index 63d48c78fe..2d8f890273 100644 --- a/src/pymor/vectorarrays/numpy.py +++ b/src/pymor/vectorarrays/numpy.py @@ -334,6 +334,9 @@ def __init__(self, dim, id_=None): def __eq__(self, other): return type(other) is type(self) and self.dim == other.dim and self.id == other.id + def __hash__(self): + return hash(self.dim) + hash(self.id) + def zeros(self, count=1, reserve=0): assert count >= 0 assert reserve >= 0