Commit 35dfa25d authored by Robert Bradshaw's avatar Robert Bradshaw

Fix issue with conditional memory views introduced by more intelligent __eq__.

parent 5e77573c
...@@ -10280,7 +10280,7 @@ class CondExprNode(ExprNode): ...@@ -10280,7 +10280,7 @@ class CondExprNode(ExprNode):
if self.true_val.type.is_pyobject or self.false_val.type.is_pyobject: if self.true_val.type.is_pyobject or self.false_val.type.is_pyobject:
self.true_val = self.true_val.coerce_to(self.type, env) self.true_val = self.true_val.coerce_to(self.type, env)
self.false_val = self.false_val.coerce_to(self.type, env) self.false_val = self.false_val.coerce_to(self.type, env)
if self.type == PyrexTypes.error_type: if self.type.is_error:
self.type_error() self.type_error()
return self return self
......
...@@ -555,8 +555,11 @@ class MemoryViewSliceType(PyrexType): ...@@ -555,8 +555,11 @@ class MemoryViewSliceType(PyrexType):
def __hash__(self): def __hash__(self):
return hash(self.__class__) ^ hash(self.dtype) ^ hash(tuple(self.axes)) return hash(self.__class__) ^ hash(self.dtype) ^ hash(tuple(self.axes))
def __eq__(self,other): def __eq__(self, other):
return self.same_as_resolved_type(other) if isinstance(other, BaseType):
return self.same_as_resolved_type(other)
else:
return False
def same_as_resolved_type(self, other_type): def same_as_resolved_type(self, other_type):
return ((other_type.is_memoryviewslice and return ((other_type.is_memoryviewslice and
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment