fix is_redeem_from_config_active type hints
This commit is contained in:
parent
6758829634
commit
50403381e0
@ -214,7 +214,7 @@ def is_redeem_active(redeem_name: str) -> bool | None:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def is_redeem_from_config_active(redeem: Redeem, active_categories: list[str]) -> bool:
|
def is_redeem_from_config_active(redeem: tuple[str, Redeem], active_categories: list[str]) -> bool:
|
||||||
"""Checks if redeem is active. `redeem` is a whole key:value pair from redeems config."""
|
"""Checks if redeem is active. `redeem` is a whole key:value pair from redeems config."""
|
||||||
if isinstance(redeem[1].get("category"), list):
|
if isinstance(redeem[1].get("category"), list):
|
||||||
for category in redeem[1]["category"]:
|
for category in redeem[1]["category"]:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from typing import Tuple, Any, TypeAlias
|
from typing import Any, TypeAlias
|
||||||
|
|
||||||
Redeem: TypeAlias = Tuple[str, dict[str, Any]]
|
Redeem: TypeAlias = dict[str, dict[str, Any]]
|
||||||
Redeems: TypeAlias = Tuple[str, Redeem]
|
# at the moment the Any could be specialized to str | int | list[str]
|
||||||
|
Redeems: TypeAlias = dict[str, Redeem]
|
Loading…
x
Reference in New Issue
Block a user