ProBoard
Other
OtherPublished Sep 23

Tkinter todo: deleting an item removes the wrong row

`TodoList.remove()` treats the task id as a list index, so deleting the middle item removes another one.

Description

Desktop todo app (Tkinter), model lives in `todo/model.py` and is covered by tests. Problem: deleting a task removes the wrong row. Task ids and list indexes drift apart as soon as something is deleted, so users lose the wrong entry. The UI calls `TodoList.remove(task_id)`. Expected: - `remove(id)` removes exactly the item with that id; - unknown ids raise `KeyError`; - `toggle`, `render` and persistence stay as they are. Acceptance: `python -m unittest discover -s tests` passes. Write me here and I'll send the project. It's for my students, so clean code matters more than speed.

Skills

  • Python
  • Tkinter