Skip to content

Tidy CABI Python code #539

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

Merged
merged 2 commits into from
Jun 26, 2025
Merged

Tidy CABI Python code #539

merged 2 commits into from
Jun 26, 2025

Conversation

lukewagner
Copy link
Member

@lukewagner lukewagner commented Jun 26, 2025

This PR hopefully addresses the confusion surfaced in #537. (No behavior change)

Copy link
Collaborator

@vados-cosmonic vados-cosmonic left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@@ -1281,40 +1279,52 @@ class ReadableStream:
read: Callable[[ComponentInstance, WritableBuffer, OnCopy, OnCopyDone], None]
cancel: Callable[[], None]
drop: Callable[[], None]

class WritableStream:
Copy link
Collaborator

@vados-cosmonic vados-cosmonic Jun 26, 2025

Choose a reason for hiding this comment

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

How strict do we want to be about this class being abstract? Not sure if we want to pull in the usual Python ABC machinery here or just add a note.

Also fine leaving this as is since this is just python flavored pseudo code :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Heh, yeah, I looked into ABC a bit, and maybe I didn't find the Zen of that feature, but I thought it was less clear -- mostly I just want a thing that lets me write names and types without function bodies. Since this is just Python-flavored pseudo-code, I stopped there, but if you have any good ideas that are clear and succinct, feel free to suggest (in a separate PR).

Co-authored-by: Victor Adossi <[email protected]>
@lukewagner lukewagner merged commit 3aef4b6 into main Jun 26, 2025
2 checks passed
@lukewagner lukewagner deleted the writable-stream branch June 26, 2025 18:48
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