Replaced importing the "typing" module as "t" with importing the individual names in the "typing" module. Since Python 3.9 introduced type hinting generics in standard collections, we do not have as many names to import now. This is also to be consistent with the practices of most major and standard packages and examples.

This commit is contained in:
2023-04-26 18:22:45 +08:00
parent ee5b447c23
commit cda9e4e3c6
25 changed files with 116 additions and 113 deletions

View File

@ -18,7 +18,7 @@
"""
import csv
import typing as t
from typing import Any
import sqlalchemy as sa
@ -39,11 +39,11 @@ def init_currencies_command(username: str) -> None:
return
creator_pk: int = get_user_pk(username)
currency_data: list[dict[str, t.Any]] = [{"code": x["code"],
"name_l10n": x["name"],
"created_by_id": creator_pk,
"updated_by_id": creator_pk}
for x in to_add]
currency_data: list[dict[str, Any]] = [{"code": x["code"],
"name_l10n": x["name"],
"created_by_id": creator_pk,
"updated_by_id": creator_pk}
for x in to_add]
locales: list[str] = [x[5:] for x in to_add[0] if x.startswith("l10n-")]
l10n_data: list[dict[str, str]] = [{"currency_code": x["code"],
"locale": y,