You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent function signatures in PyBricks 2.0 API: EV3Brick.speaker.play_file(file_name=...); DriveBase.drive(drive_speed=...) #23
Hi @laurensvalk@dlech, it seems the following function signatures are inconsistent between the PyBricks 2.0 API and the pybricks-micropython interpreter:
Pybricks 2.0 API: EV3Brick.speaker.play_file(file_name=...) vs.
pybricks-micropython: EV3Brick.speaker.play_file(file=...)
Pybricks 2.0 API: DriveBase.drive(drive_speed=...) vs.
pybricks-micropython: DriveBase.drive(speed=...)
We haven't decided yet. The ones in the API are (were intended to be) correct, but since the 2.0 release is already out, we'll have to rethink if it makes sense to change the implementation at this point.
If you're worried about script compatibility, you can just omit using the keywords for now.
Just some minor stuff: the auto-complete signature for DriveBase.drive(...) -- e.g., on VSCode -- continues to show the drive_speed=... argument, instead of just speed=....
We're actually using the bleeding-edge master branch (by python3 -m pip install https://GitHub.com/Pybricks/Pybricks-API/archive/master.zip) and that is still showing.
Activity
laurensvalk commentedon Jun 21, 2020
Good catch, thanks! I can confirm the mismatch in the source code.
TheVinhLuong102 commentedon Jun 21, 2020
@laurensvalk that's great. Could you let me know which set of signatures is the right one going forward?
laurensvalk commentedon Jun 21, 2020
We haven't decided yet. The ones in the API are (were intended to be) correct, but since the 2.0 release is already out, we'll have to rethink if it makes sense to change the implementation at this point.
If you're worried about script compatibility, you can just omit using the keywords for now.
TheVinhLuong102 commentedon Jun 21, 2020
Ok @laurensvalk. Let's keep this issue open till the next release then?
laurensvalk commentedon Jul 7, 2020
This is fixed in 82b16dc and 55c4c86. Thank you for reporting!
TheVinhLuong102 commentedon Jul 7, 2020
thank you @laurensvalk :)
TheVinhLuong102 commentedon Jul 30, 2021
Hi @laurensvalk, @dlech,
Just some minor stuff: the auto-complete signature for
DriveBase.drive(...)-- e.g., on VSCode -- continues to show thedrive_speed=...argument, instead of justspeed=....Please see the attached screenshot.
Thank you.
Vinh
dlech commentedon Jul 30, 2021
The
pybrickspackage is out of date. There is an issue for this: #73TheVinhLuong102 commentedon Jul 30, 2021
Hi @dlech,
We're actually using the bleeding-edge master branch (by
python3 -m pip install https://GitHub.com/Pybricks/Pybricks-API/archive/master.zip) and that is still showing.Vinh
dlech commentedon Jul 30, 2021
OK, best to open a new issue then instead of commenting on a closed one.