Added TypedDict implementation for currencies.
This commit is contained in:
parent
27bfb613d6
commit
be640a8b60
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user