Skip to content

Commit

Permalink
refactor: add type hints to empty lists
Browse files Browse the repository at this point in the history
  • Loading branch information
mecaneer23 committed Dec 15, 2023
1 parent d7e126e commit 99a9b81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/menus.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ def get_sorting_methods() -> dict[str, Callable[..., str]]:


def get_indented_sections(todos: Todos) -> list[Todos]:
indented_sections = []
section = []
indented_sections: list[Todos] = []
section: Todos = Todos([])
for todo in todos:
if todo.indent_level > 0:
section.append(todo)
continue
if len(section) > 0:
indented_sections.append(section)
section = [todo]
section = Todos([todo])
indented_sections.append(section)
return indented_sections

Expand Down

0 comments on commit 99a9b81

Please sign in to comment.