-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomers
Description
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
| 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.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomers