1
0
Fork 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
1 changed files with 11 additions and 2 deletions

View File

@ -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",