Repository navigation
fix(typing): add missing @classmethod to SE3.Eul, SE3.RPY, SE3.Trans overloads - #283
Open
filipjsowa wants to merge 1 commit into
Open
filipjsowa wants to merge 1 commit into
filipjsowa wants to merge 1 commit into
Conversation
…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 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
@overloadstubs forSE3.Eul,SE3.RPYandSE3.Translacked@classmethod(only the implementations had it), so type checkers bound the first call argument toclsand flagged valid calls as errors:This shows up in VS Code by default, since Pylance uses Pyright. This adds
@classmethodunder each@overload, matching the order already used bySO3.Eul/SO3.RPY.Checked with
pyrighton a file calling each overload (Trans(x, y, z),Trans([x, y, z]),Eul/RPYwith scalars and a list): 10 errors before, 0 after, andSE3.Trans(...)is now inferred asSE3instead ofUnknown. There's no runtime change, because overload stubs are discarded at definition time. No test added, since CI doesn't run a type checker yet (#143).🤖 Generated with Claude Code