diff --git a/piggybank/currencies.py b/piggybank/currencies.py index 3b76c01..c5ff68b 100644 --- a/piggybank/currencies.py +++ b/piggybank/currencies.py @@ -17,7 +17,7 @@ fields: divide this number by 100 to get a regular floating-point number. """ -from typing import Dict, List +from typing import Dict, List, TypedDict __all__ = ["CURRENCIES", "DEFAULT_CURRENCY", "BaseCurrencyError", "CurrencyIsNotSupportedError", "CurrenciesCoinCountMismatchError", @@ -53,7 +53,16 @@ class CurrenciesCoinCountMismatchError(BaseCurrencyError): DEFAULT_CURRENCY: str = "SRUB" -CURRENCIES: Dict[Dict[str, str, int, List[str], List[int]]] = { + +class Currency(TypedDict): + name: str + description: str + count: int + names: List[str] + multipliers: List[int] + + +CURRENCIES: Dict[str, Currency] = { "RUB": { "name": "Ruble", "description": "Russian Federation",