mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-14 18:47:32 +00:00
pybricks/robotics.pyi: improve type hint (#60)
* Allow the wheel diameter and axle track of a DriveBase to be an int or a float
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Copyright (c) 2020 The Pybricks Authors
|
||||
|
||||
from typing import Optional, Tuple, overload
|
||||
from typing import Optional, Tuple, overload, Union
|
||||
from ._common import Control, Motor
|
||||
|
||||
class DriveBase:
|
||||
@@ -11,8 +11,8 @@ class DriveBase:
|
||||
self,
|
||||
left_motor: Motor,
|
||||
right_motor: Motor,
|
||||
wheel_diameter: int,
|
||||
axle_track: int,
|
||||
wheel_diameter: Union[int, float],
|
||||
axle_track: Union[int, float],
|
||||
): ...
|
||||
def drive(self, drive_speed: int, turn_rate: int) -> None: ...
|
||||
def stop(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user