aboutsummaryrefslogtreecommitdiff
path: root/src/utils/__init__.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-30 17:49:35 +0000
committerGravatar jesopo2018-10-30 17:49:35 +0000
commitb543e31cd2a665b25aab4554e46a0ed5067d1bfe (patch)
tree285e0b52f45e167dbc381951482c7bff660c6630 /src/utils/__init__.py
parentTypo in src/Exports; 'self_exports' -> 'self.exports' (diff)
signature
Fix/refactor issues brought up by type hint linting
Diffstat (limited to 'src/utils/__init__.py')
-rw-r--r--src/utils/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/__init__.py b/src/utils/__init__.py
index 52de64ba..f60c199e 100644
--- a/src/utils/__init__.py
+++ b/src/utils/__init__.py
@@ -93,9 +93,9 @@ def parse_number(s: str) -> str:
pass
unit = s[-1].lower()
- number = s[:-1]
+ number_str = s[:-1]
try:
- number = decimal.Decimal(number)
+ number = decimal.Decimal(number_str)
except:
raise ValueError("Invalid format '%s' passed to parse_number" % number)
@@ -155,7 +155,7 @@ def export(setting: str, value: typing.Any):
return _export_func
TOP_10_CALLABLE = typing.Callable[[typing.Any], typing.Any]
-def top_10(items: typing.List[typing.Any],
+def top_10(items: typing.Dict[typing.Any, typing.Any],
convert_key: TOP_10_CALLABLE=lambda x: x,
value_format: TOP_10_CALLABLE=lambda x: x):
top_10 = sorted(items.keys())