from typing import List, Sequence from .todo_item import Todo from .todo_list_update_todo import index_of_todo def remove_todo(todos: Sequence[Todo], id: str) -> List[Todo]: """Delete one todo; the others keep their order values (gaps are harmless).""" at = index_of_todo(todos, id) return [t for i, t in enumerate(todos) if i != at]