-
Notifications
You must be signed in to change notification settings - Fork 16
chore: move CancelledError and InvalidStateError to tasks #55
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
Changes from 1 commit
529b01d
516dc86
3fd6059
3921b20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,18 @@ | |
from . import core | ||
|
||
|
||
class CancelledError(BaseException): | ||
"""Injected into a task when calling `Task.cancel()`""" | ||
|
||
pass | ||
|
||
|
||
class InvalidStateError(Exception): | ||
"""Can be raised in situations like setting a result value for a task object that already has a result value set.""" | ||
|
||
pass | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could define these conditionally by testing whether they are in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can do that, sure. To clarify, I was kind of doing this already by the Even with that in mind, these should use
Where they live is somewhat inconsequential, as long as they're loaded when they don't exist in CircuitPython proper. An alternative was that they'd live under an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking these exceptions are defined unconditionally in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If With this new change, if If you think that's a concern I can move them to their own conditionally imported file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, it would be a waste of time and RAM space if it gets imported. So maybe just define them inside one of the arms of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated per request - it's in the import |
||
# pairing-heap meld of 2 heaps; O(1) | ||
def ph_meld(h1, h2): | ||
if h1 is None: | ||
|
Uh oh!
There was an error while loading. Please reload this page.