Skip to content

Commit 910172b

Browse files
committed
Generalise __truediv__ implementation in BaseTwist
1 parent 586b4b0 commit 910172b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spatialmath/twist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def __ne__(left, right): # lgtm[py/not-named-self] pylint: disable=no-self-argu
282282

283283
def __truediv__(left, right): # lgtm[py/not-named-self] pylint: disable=no-self-argument
284284
if base.isscalar(right):
285-
return Twist3(left.S / right)
285+
return type(left)(left.S / right)
286286
else:
287287
raise ValueError('Twist /, incorrect right operand')
288288

@@ -1714,4 +1714,4 @@ def _repr_pretty_(self, p, cycle):
17141714

17151715
# import pathlib
17161716

1717-
# exec(open(pathlib.Path(__file__).parent.parent.absolute() / "tests" / "test_twist.py").read()) # pylint: disable=exec-used
1717+
# exec(open(pathlib.Path(__file__).parent.parent.absolute() / "tests" / "test_twist.py").read()) # pylint: disable=exec-used

0 commit comments

Comments
 (0)