1
0

Added TypedDict implementation for currencies.

This commit is contained in:
Alexander "Arav" Andreev 2019-12-26 00:00:59 +04:00 committed by Alexander Arav Andreev
parent 27bfb613d6
commit be640a8b60

View File

@ -17,7 +17,7 @@ fields:
divide this number by 100 to get a regular floating-point number. 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", __all__ = ["CURRENCIES", "DEFAULT_CURRENCY", "BaseCurrencyError",
"CurrencyIsNotSupportedError", "CurrenciesCoinCountMismatchError", "CurrencyIsNotSupportedError", "CurrenciesCoinCountMismatchError",
@ -53,7 +53,16 @@ class CurrenciesCoinCountMismatchError(BaseCurrencyError):
DEFAULT_CURRENCY: str = "SRUB" 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": { "RUB": {
"name": "Ruble", "name": "Ruble",
"description": "Russian Federation", "description": "Russian Federation",