Something went wrong. Try again.
An experimental alternative to Rust sans-io that enables the direct style
Something went wrong. Try again.
560 B · 28 lines
Python
at experiments
1234567891011121314151617181920212223242526272829"""Status and error codes as they cross the ABI. Non-negative is a status,negative is an error. The union of both cdylibs' codes; each uses a subset."""
AWAITING = 0COMPLETE = 1STALLED = 2
BUSY = -1FINISHED = -2PANICKED = -4BAD_HANDLE = -5BAD_INPUT = -6
_NAMES = { AWAITING: "AWAITING", COMPLETE: "COMPLETE", STALLED: "STALLED", BUSY: "BUSY", FINISHED: "FINISHED", PANICKED: "PANICKED", BAD_HANDLE: "BAD_HANDLE", BAD_INPUT: "BAD_INPUT",}
def describe(code: int) -> str: return _NAMES.get(code, f"code {code}")