]> Nutra Git (v1) - nutratech/cli.git/commitdiff
`: list` can be replaced with `: Sequence[...]`
authorShane Jaroch <chown_tee@proton.me>
Fri, 19 Apr 2024 17:20:20 +0000 (13:20 -0400)
committerShane Jaroch <chown_tee@proton.me>
Fri, 19 Apr 2024 17:20:20 +0000 (13:20 -0400)
ntclient/services/usda.py

index d15736dc557dde0904808ce44f17c23040034f6e..5138e8a86511b8985b148a5e3992f0b7454e1776 100644 (file)
@@ -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)