Some of the __eq__ operators in cuda_core assuming that the rhs side will be the same type as the lhs. This will result in raising an AttributeError (or worse) rather than returning False.
We need to do something like this (across the whole codebase):
- def __eq__(self : _StridedLayout, other : _StridedLayout) -> bool:
- return self.itemsize == other.itemsize and self.slice_offset == other.slice_offset and _base_layout_equal(self.base, other.base)
+ def __eq__(self, other) -> bool:
+ if not isinstance(other, _StridedLayout):
+ return NotImplemented
+ cdef _StridedLayout _other = <_StridedLayout>other
+ return self.itemsize == _other.itemsize and self.slice_offset == _other.slice_offset and _base_layout_equal(self.base, _other.base)
(PS: Found as part of adding type checking)
Some of the
__eq__operators in cuda_core assuming that the rhs side will be the same type as the lhs. This will result in raising anAttributeError(or worse) rather than returningFalse.We need to do something like this (across the whole codebase):
(PS: Found as part of adding type checking)