Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling additional MicroPython features #60

Merged
merged 2 commits into from
Jul 30, 2021
Merged

Enabling additional MicroPython features #60

merged 2 commits into from
Jul 30, 2021

Conversation

laurensvalk
Copy link
Member

@laurensvalk laurensvalk commented Jul 28, 2021

Opening this for discussion.

Documenting (and finalizing some of the) MicroPython functionality and modules is part of the v3.1 roadmap. It would be nice if we can do anticipated features while we are at it.

We don't need to enable all of these, but it's worth having a look. On Prime Hub, these are the size increases:

base: 228292

  • bytearray: +3232
  • set: +2396
  • ustruct: +1388

total: +7K

bytearray and ustruct would seem useful for hub-to-hub communication which will rely heavily on byte streams.

Set is probably less critical.

This intends to address pybricks/support#140

This is useful for dealing wih streams of data without having to re-allocate immutable bytes objects. For example, it can be used with usys.stdin.buffer.readinto.

This is primarily useful when hub-to-hub communication is added in future releases.
@dlech
Copy link
Member

dlech commented Jul 28, 2021

:shipit:

Would we change buttons.pressed() to return a set on platforms that support it?

@laurensvalk
Copy link
Member Author

Perhaps unsurprisingly, but archiving for future reference, enabling array is only 276 more bytes if bytearray is enabled. I personally don't really use it much.

This is useful for packing and unpacking binary data.

This is primarily useful when hub-to-hub communication is added in future releases.
@laurensvalk
Copy link
Member Author

Would we change buttons.pressed() to return a set on platforms that support it?

Perhaps not now, so let's leave out set as it may not be worth the 2396 bytes. We can reconsider it later when we know how much space Bluetooth will require.

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