-
Notifications
You must be signed in to change notification settings - Fork 893
Open
Labels
bugBug reportBug report
Description
Description
mypy finds errors in the gtsam's generated .pyi files, because reserved python keywords (e.g. global and lambda) are used as argument names.
I observed the problem in gtsam 4.3a0 and gtsam 4.3a1.
Steps to reproduce
$ cmake .. -DGTSAM_BUILD_PYTHON=1
...
-- Build files have been written to: /home/me/Downloads/gtsam-4.3a1/build$ make python-install
...
Successfully installed gtsam-4.3a1
[100%] Built target python-install$ mypy --version
mypy 1.19.1 (compiled: yes)$ mypy python/gtsam/gtsam/__init__.pyi
python/gtsam/gtsam/__init__.pyi:11941: error: Invalid syntax [syntax]
Found 1 error in 1 file (errors prevented further checking)$ sed -n 11941p python/gtsam/gtsam/__init__.pyi
def evaluateError(self, global: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 1]"], trans: Pose3, local: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 1]"]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]:Expected behavior
Reserved python keywords should not be used as argument names .pyi files, mypy should not find errors in .pyi files.
Metadata
Metadata
Assignees
Labels
bugBug reportBug report