Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions clifford/_multivector.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ def _checkOther(self, other, coerce=True) -> Tuple['MultiVector', bool]:

_checkOther(other, coerce=True) --> newOther, isMultiVector
"""
if isinstance(other, numbers.Number):
if isinstance(other, MultiVector):
if other.layout != self.layout:
raise ValueError(
"cannot operate on MultiVectors with different Layouts")
else:
return other, True
elif isinstance(other, numbers.Number):
if coerce:
# numeric scalar
newOther = self._newMV(dtype=np.result_type(other))
Expand All @@ -70,12 +76,6 @@ def _checkOther(self, other, coerce=True) -> Tuple['MultiVector', bool]:
else:
return other, False

elif isinstance(other, MultiVector):
if other.layout != self.layout:
raise ValueError(
"cannot operate on MultiVectors with different Layouts")
else:
return other, True
else:
return other, False

Expand Down