Skip to content

Inconsistent function signatures in PyBricks 2.0 API: EV3Brick.speaker.play_file(file_name=...); DriveBase.drive(drive_speed=...) #23

Closed

Description

@TheVinhLuong102

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=...)

Thank you.

Activity

  1. laurensvalk commented on Jun 21, 2020

    @laurensvalk
    Member

    Good catch, thanks! I can confirm the mismatch in the source code.

  2. TheVinhLuong102 commented on Jun 21, 2020

    @TheVinhLuong102
    ContributorAuthor

    @laurensvalk that's great. Could you let me know which set of signatures is the right one going forward?

  3. laurensvalk commented on Jun 21, 2020

    @laurensvalk
    Member

    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.

  4. TheVinhLuong102 commented on Jun 21, 2020

    @TheVinhLuong102
    ContributorAuthor

    Ok @laurensvalk. Let's keep this issue open till the next release then?

  5. laurensvalk commented on Jul 7, 2020

    @laurensvalk
    Member

    This is fixed in 82b16dc and 55c4c86. Thank you for reporting!

  6. TheVinhLuong102 commented on Jul 7, 2020

    @TheVinhLuong102
    ContributorAuthor

    thank you @laurensvalk :)

  7. TheVinhLuong102 commented on Jul 30, 2021

    @TheVinhLuong102
    ContributorAuthor

    Hi @laurensvalk, @dlech,

    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=....

    Please see the attached screenshot.

    Thank you.

    Vinh

    Screen Shot 2021-07-30 at 13 04 43

  8. dlech commented on Jul 30, 2021

    @dlech
    Member

    The pybricks package is out of date. There is an issue for this: #73

  9. TheVinhLuong102 commented on Jul 30, 2021

    @TheVinhLuong102
    ContributorAuthor

    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

  10. dlech commented on Jul 30, 2021

    @dlech
    Member

    OK, best to open a new issue then instead of commenting on a closed one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions