mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-28 04:07:46 +00:00
Robotics.py: Fix issue with the type stub for DriveBase.angle() (#165)
The type was changed from `int` to `float` in https://github.com/pybricks/pybricks-micropython/commit/4d457a17fc13d42d9b311df99e05dafaeed67862. Technically, it is still `int` on BOOST Move hub (any system without floating point support). But most platforms use `float` so makes sense to have that in the type hints.
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed `DriveBase.angle` reporting an incorrect return type.
|
||||
|
||||
## 3.6.1 - 2025-05-01
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -1020,7 +1020,7 @@ METHOD_PARAMS = [
|
||||
pytest.param("pybricks.robotics", "DriveBase", "stop", [([], "None")]),
|
||||
pytest.param("pybricks.robotics", "DriveBase", "brake", [([], "None")]),
|
||||
pytest.param("pybricks.robotics", "DriveBase", "distance", [([], "int")]),
|
||||
pytest.param("pybricks.robotics", "DriveBase", "angle", [([], "int")]),
|
||||
pytest.param("pybricks.robotics", "DriveBase", "angle", [([], "float")]),
|
||||
pytest.param(
|
||||
"pybricks.robotics", "DriveBase", "state", [([], "Tuple[int, int, int, int]")]
|
||||
),
|
||||
|
||||
@@ -101,8 +101,8 @@ class DriveBase:
|
||||
Driven distance since last reset.
|
||||
"""
|
||||
|
||||
def angle(self) -> int:
|
||||
"""angle() -> int: deg
|
||||
def angle(self) -> float:
|
||||
"""angle() -> float: deg
|
||||
|
||||
Gets the estimated rotation angle of the drive base.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user