From 1cf83adf87bcea38d60432254b0ec28a9b8bbf16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sun, 3 Mar 2024 07:39:20 +0800 Subject: [PATCH] Applied the "type" statement to type aliases for Python 3.12. --- src/accounting/account/commands.py | 4 ++-- src/accounting/utils/user.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/accounting/account/commands.py b/src/accounting/account/commands.py index f30c80a..df751d0 100644 --- a/src/accounting/account/commands.py +++ b/src/accounting/account/commands.py @@ -1,7 +1,7 @@ # The Mia! Accounting Project. # Author: imacat@mail.imacat.idv.tw (imacat), 2023/1/30 -# Copyright (c) 2023 imacat. +# Copyright (c) 2023-2024 imacat. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ from accounting import db from accounting.models import BaseAccount, Account, AccountL10n from accounting.utils.user import get_user_pk -AccountData = tuple[int, str, int, str, str, str, bool] +type AccountData = tuple[int, str, int, str, str, str, bool] """The format of the account data, as a list of (ID, base account code, number, English, Traditional Chinese, Simplified Chinese, is-need-offset) tuples.""" diff --git a/src/accounting/utils/user.py b/src/accounting/utils/user.py index a0168e4..d6d3b87 100644 --- a/src/accounting/utils/user.py +++ b/src/accounting/utils/user.py @@ -1,7 +1,7 @@ # The Mia! Accounting Project. # Author: imacat@mail.imacat.idv.tw (imacat), 2023/2/1 -# Copyright (c) 2023 imacat. +# Copyright (c) 2023-2024 imacat. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -113,7 +113,7 @@ class UserUtilityInterface(Generic[T], ABC): __user_utils: UserUtilityInterface """The user utilities.""" -user_cls: Type[Model] = Model +type user_cls = Model """The user class.""" user_pk_column: sa.Column = sa.Column(sa.Integer) """The primary key column of the user class."""