Replace typing.Type with built-in type[] for Python 3.12.

This commit is contained in:
2026-04-05 21:49:17 +08:00
parent cca3f89bf1
commit 356950e2c7
9 changed files with 19 additions and 26 deletions
@@ -18,7 +18,6 @@
"""
from abc import ABC, abstractmethod
from typing import Type
from flask import render_template, request, abort
from flask_wtf import FlaskForm
@@ -38,7 +37,7 @@ class JournalEntryOperator(ABC):
@property
@abstractmethod
def form(self) -> Type[JournalEntryForm]:
def form(self) -> type[JournalEntryForm]:
"""Returns the form class.
:return: The form class.
@@ -99,7 +98,7 @@ class CashReceiptJournalEntry(JournalEntryOperator):
"""The order when checking the journal entry operator."""
@property
def form(self) -> Type[JournalEntryForm]:
def form(self) -> type[JournalEntryForm]:
"""Returns the form class.
:return: The form class.
@@ -169,7 +168,7 @@ class CashDisbursementJournalEntry(JournalEntryOperator):
"""The order when checking the journal entry operator."""
@property
def form(self) -> Type[JournalEntryForm]:
def form(self) -> type[JournalEntryForm]:
"""Returns the form class.
:return: The form class.
@@ -242,7 +241,7 @@ class TransferJournalEntry(JournalEntryOperator):
"""The order when checking the journal entry operator."""
@property
def form(self) -> Type[JournalEntryForm]:
def form(self) -> type[JournalEntryForm]:
"""Returns the form class.
:return: The form class.