fix(python): use standard dict/list type annotation

Since Python 3.9 list/dict can be used as type hint.
This commit is contained in:
Jelle van der Waa 2022-07-31 20:58:39 +02:00 committed by Jelle van der Waa
parent 28970ccc91
commit a509e40474
31 changed files with 175 additions and 195 deletions

View file

@ -1,4 +1,4 @@
from typing import Any, Dict
from typing import Any
from fastapi import Request
@ -34,7 +34,7 @@ def simple(U: str = str(), E: str = str(), H: bool = False,
def language(L: str = str(),
request: Request = None,
user: models.User = None,
context: Dict[str, Any] = {},
context: dict[str, Any] = {},
**kwargs) -> None:
if L and L != user.LangPreference:
with db.begin():
@ -45,7 +45,7 @@ def language(L: str = str(),
def timezone(TZ: str = str(),
request: Request = None,
user: models.User = None,
context: Dict[str, Any] = {},
context: dict[str, Any] = {},
**kwargs) -> None:
if TZ and TZ != user.Timezone:
with db.begin():
@ -95,7 +95,7 @@ def account_type(T: int = None,
def password(P: str = str(),
request: Request = None,
user: models.User = None,
context: Dict[str, Any] = {},
context: dict[str, Any] = {},
**kwargs) -> None:
if P and not user.valid_password(P):
# Remove the fields we consumed for passwords.