Skip to content

Commit fb8198f

Browse files
authored
pybricks/robotics.pyi: improve type hint (#60)
* Allow the wheel diameter and axle track of a DriveBase to be an int or a float
1 parent 3dad15a commit fb8198f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pybricks/robotics.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: MIT
22
# Copyright (c) 2020 The Pybricks Authors
33

4-
from typing import Optional, Tuple, overload
4+
from typing import Optional, Tuple, overload, Union
55
from ._common import Control, Motor
66

77
class DriveBase:
@@ -11,8 +11,8 @@ class DriveBase:
1111
self,
1212
left_motor: Motor,
1313
right_motor: Motor,
14-
wheel_diameter: int,
15-
axle_track: int,
14+
wheel_diameter: Union[int, float],
15+
axle_track: Union[int, float],
1616
): ...
1717
def drive(self, drive_speed: int, turn_rate: int) -> None: ...
1818
def stop(self) -> None: ...

0 commit comments

Comments
 (0)