From b7d45d64ed099bf0a44bc4152deca0a45bdf4c1b Mon Sep 17 00:00:00 2001 From: Filip Sowa Date: Wed, 4 Nov 2026 15:54:08 +0200 Subject: [PATCH] fix(typing): add missing @classmethod to SE3.Eul, SE3.RPY, SE3.Trans overloads The @overload stubs for these classmethods were declared without @classmethod, so type checkers (Pyright/Pylance, mypy) bound the first call argument to cls and reported valid calls such as SE3.Trans(0, 0, 0.1) as errors. Match the ordering already used by SO3.Eul/SO3.RPY (@overload then @classmethod). Co-Authored-By: Claude Opus 5.5 --- spatialmath/pose3d.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spatialmath/pose3d.py b/spatialmath/pose3d.py index dfc91a86..5c5d5a94 100644 --- a/spatialmath/pose3d.py +++ b/spatialmath/pose3d.py @@ -1685,10 +1685,12 @@ def Rand( ) @overload + @classmethod def Eul(cls, phi: float, theta: float, psi: float, unit: str = "rad") -> SE3: ... @overload + @classmethod def Eul(cls, angles: ArrayLike3, unit: str = "rad") -> SE3: ... @@ -1735,10 +1737,12 @@ def Eul(cls, *angles, unit="rad") -> SE3: return cls([smb.eul2tr(a, unit=unit) for a in angles], check=False) @overload + @classmethod def RPY(cls, roll: float, pitch: float, yaw: float, unit: str = "rad") -> SE3: ... @overload + @classmethod def RPY(cls, angles: ArrayLike3, unit: str = "rad") -> SE3: ... @@ -1985,10 +1989,12 @@ def Delta(cls, d: ArrayLike6) -> SE3: return cls(smb.trnorm(smb.delta2tr(d))) @overload + @classmethod def Trans(cls, x: float, y: float, z: float) -> SE3: ... @overload + @classmethod def Trans(cls, xyz: ArrayLike3) -> SE3: ...