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

@ -17,12 +17,13 @@
"""The current assets and liabilities account.
"""
import typing as t
from typing import Self
import sqlalchemy as sa
from accounting import db
from accounting.locale import gettext
from accounting.models import Account
import sqlalchemy as sa
class CurrentAccount:
@ -54,7 +55,7 @@ class CurrentAccount:
return self.str
@classmethod
def current_assets_and_liabilities(cls) -> t.Self:
def current_assets_and_liabilities(cls) -> Self:
"""Returns the pseudo account for all current assets and liabilities.
:return: The pseudo account for all current assets and liabilities.
@ -67,7 +68,7 @@ class CurrentAccount:
return account
@classmethod
def accounts(cls) -> list[t.Self]:
def accounts(cls) -> list[Self]:
"""Returns the current assets and liabilities accounts.
:return: The current assets and liabilities accounts.