new val_sum for refactoring

This commit is contained in:
klemek
2021-01-14 17:22:59 +01:00
parent c938369eba
commit e1c619dabb
3 changed files with 12 additions and 8 deletions
+5 -1
View File
@@ -1,4 +1,4 @@
from typing import List, Dict, Union, Optional
from typing import List, Dict, Union, Optional, Any
import os
import logging
import discord
@@ -91,6 +91,10 @@ def top_key(d: Dict[Union[str, int], int]) -> Union[str, int]:
return sorted(d, key=lambda k: d[k])[-1]
def val_sum(d: Dict[Any, int]) -> int:
return sum(d.value())
# MESSAGE FORMATTING