September 2017
Intermediate to advanced
222 pages
5h 1m
English
Exceptions may be raised in a few places in the Tasks API. Let’s take a quick peek at the functions found in tasks/api.py:
| | def add(task): # type: (Task) -> int |
| | def get(task_id): # type: (int) -> Task |
| | def list_tasks(owner=None): # type: (str|None) -> list of Task |
| | def count(): # type: (None) -> int |
| | def update(task_id, task): # type: (int, Task) -> None |
| | def delete(task_id): # type: (int) -> None |
| | def delete_all(): # type: () -> None |
| | def unique_id(): # type: () -> int |
| | def start_tasks_db(db_path, db_type): # type: (str, str) -> None |
| | def stop_tasks_db(): # type: () -> None |
There’s an agreement between the CLI code in cli.py and the API code in api.py as to what types will be sent ...
Read now
Unlock full access