Now that TypeIs is in use, exhaustive type checking can be asserted at compile time instead of run time; for example, here:
|
if success(response): |
|
print(f"Received response: {response}") |
|
elif error(response): |
|
print(f"Received error: {response}") |
|
else: |
|
raise Exception(f"Unknown response: {response}") |
The examples should demonstrate this approach.
Now that TypeIs is in use, exhaustive type checking can be asserted at compile time instead of run time; for example, here:
smpclient/examples/ble/imagestate.py
Lines 26 to 31 in 83cfd1c
The examples should demonstrate this approach.