Commit 23318496 authored by Robert Bradshaw's avatar Robert Bradshaw

Merge branch 'mattjj-fix-vectors-of-memviews'

parents 9dd1892b 35dfa25d
......@@ -10301,7 +10301,7 @@ class CondExprNode(ExprNode):
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.false_val = self.false_val.coerce_to(self.type, env)
if self.type == PyrexTypes.error_type:
if self.type.is_error:
self.type_error()
return self
......
......@@ -552,6 +552,15 @@ class MemoryViewSliceType(PyrexType):
if not self.dtype.is_fused:
self.dtype_name = MemoryView.mangle_dtype_name(self.dtype)
def __hash__(self):
return hash(self.__class__) ^ hash(self.dtype) ^ hash(tuple(self.axes))
def __eq__(self, other):
if isinstance(other, BaseType):
return self.same_as_resolved_type(other)
else:
return False
def same_as_resolved_type(self, other_type):
return ((other_type.is_memoryviewslice and
self.dtype.same_as(other_type.dtype) and
......@@ -670,6 +679,10 @@ class MemoryViewSliceType(PyrexType):
return True
def specialization_name(self):
return super(MemoryViewSliceType,self).specialization_name() \
+ '_' + self.specialization_suffix()
def specialization_suffix(self):
return "%s_%s" % (self.axes_to_name(), self.dtype_name)
......
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