From dec9c950c183450ec08169dff1b5759c83d226bb Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Fri, 19 Apr 2024 13:20:20 -0400 Subject: [PATCH] `: list` can be replaced with `: Sequence[...]` --- ntclient/services/usda.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ntclient/services/usda.py b/ntclient/services/usda.py index d15736d..5138e8a 100644 --- a/ntclient/services/usda.py +++ b/ntclient/services/usda.py @@ -6,6 +6,7 @@ Created on Sat Oct 27 20:28:06 2018 """ import pydoc +from typing import Sequence, Optional from tabulate import tabulate @@ -61,7 +62,9 @@ def sort_foods( # TODO: sub shrt_desc for long if available, and support config.FOOD_NAME_TRUNC - def print_results(_results: list, _nutrient_id: int) -> list: + def print_results( + _results: Sequence[Sequence[Optional[float]]], _nutrient_id: int + ) -> None: """Prints truncated list for sort""" nutrients = sql_nutrients_overview() nutrient = nutrients[_nutrient_id] @@ -72,7 +75,6 @@ def sort_foods( table = tabulate(_results, headers=headers, tablefmt="simple") print(table) - return _results # Gets values for nutrient_id and kcal=208 nut_data = sql_sort_helper1(nutrient_id) -- 2.52.0