Skip to content

Conversation

fkleon
Copy link

@fkleon fkleon commented Jun 24, 2025

Hi @laurensvalk and @dlech

I'm implementing the Pybricks BLE interfaces in my pybricks-ble project, and noticed that some of the type hints are inaccurate/incomplete. That makes the type checker unhappy when trying to mimic Pybricks behaviour, but with the changes in this PR I was able to get everything working (see fkleon/pybricks-ble#9).

Update API docs and code completions for the following changes:

fkleon added 4 commits June 24, 2025 23:38
Update type hint for broadcast_channel to Optional, as None is allowed.
- Add overloads for broadcast(). It accepts either a single value, or a tuple,
  or a list.

- Adjust return type of observe(). It either returns a single value, or a tuple.
Copy link
Member

@dlech dlech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines +92 to +94
"broadcast",
"observe",
"observe_enable",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of these aren't in the docs, so I'm not sure they are meant to be public.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

observe_enable() was undocumented, but mentioned in the release changelog. I could extract that into a separate MR if you'd rather not add it to the public docs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait and see what @laurensvalk says.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants