-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Problem description
Here is the violating code snippet:
def remapper(length: int, idx: int) -> int:
idx = int(idx)
splits = [
0,
int(length * self.right_rear_front_split),
int(length * self.halfway_split),
int(length * self.left_front_rear_split),
]
if splits[0] <= int(idx) < splits[1]:
return int(splits[1] - splits[0]) - idx
elif splits[2] <= int(idx) < splits[3]:
return int(splits[3] - splits[2]) - (idx - splits[2]) + splits[2]
else:
return int(idx)
forward = forward_pattern.mapIndex(remapper)
according to the type in the binding code the types expected by mapIndex are typing.SupportsInt
so this is not expected
Here is error according to vscode
Argument of type "(length: int, idx: int) -> int" cannot be assigned to parameter "indexMapper" of type "(SupportsInt, SupportsInt) -> int" in function "mapIndex"
Type "(length: int, idx: int) -> int" is not assignable to type "(SupportsInt, SupportsInt) -> int"
Parameter 1: type "SupportsInt" is incompatible with type "int"
"SupportsInt" is not assignable to "int"
Parameter 2: type "SupportsInt" is incompatible with type "int"
"SupportsInt" is not assignable to "int"Pylance[reportArgumentType](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportArgumentType)
Operating System
Linux
Installed Python Packages
"numpy~=2.2",
"phoenix6~=25.3.1",
"robotpy-ctre~=2025.0.2",
"robotpy[apriltag]==2025.3.2.1",
"robotpy-rev~=2025.0.3",
"robotpy-wpilib-utilities==2025.1.0",
"photonlibpy~=2025.3.1",
"sleipnirgroup-choreolib~=2025.0.3",
Reproducible example code
Metadata
Metadata
Assignees
Labels
No labels