From a6ddc8e5bdd149d06c5fa7a1f174a546505e88c1 Mon Sep 17 00:00:00 2001 From: snowy Date: Thu, 29 Aug 2024 15:12:49 +0800 Subject: [PATCH] =?UTF-8?q?:memo:=20=E6=9E=84=E5=BB=BA=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mbcp/mp_math/mp_math_typing.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/mbcp/mp_math/mp_math_typing.py b/mbcp/mp_math/mp_math_typing.py index c7285c3..5190894 100644 --- a/mbcp/mp_math/mp_math_typing.py +++ b/mbcp/mp_math/mp_math_typing.py @@ -10,24 +10,24 @@ Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved """ from typing import Callable, Iterable, TypeAlias, TypeVar -RealNumber: TypeAlias = int | float -Number: TypeAlias = RealNumber | complex -SingleVar = TypeVar("SingleVar", bound=Number) -ArrayVar = TypeVar("ArrayVar", bound=Iterable[Number]) -Var: TypeAlias = SingleVar | ArrayVar +RealNumber: TypeAlias = int | float # 实数 +Number: TypeAlias = RealNumber | complex # 数 +SingleVar = TypeVar("SingleVar", bound=Number) # 单变量 +ArrayVar = TypeVar("ArrayVar", bound=Iterable[Number]) # 数组变量 +Var: TypeAlias = SingleVar | ArrayVar # 变量 -OneSingleVarFunc: TypeAlias = Callable[[SingleVar], SingleVar] -OneArrayFunc: TypeAlias = Callable[[ArrayVar], ArrayVar] -OneVarFunc: TypeAlias = OneSingleVarFunc | OneArrayFunc +OneSingleVarFunc: TypeAlias = Callable[[SingleVar], SingleVar] # 一元单变量函数 +OneArrayFunc: TypeAlias = Callable[[ArrayVar], ArrayVar] # 一元数组函数 +OneVarFunc: TypeAlias = OneSingleVarFunc | OneArrayFunc # 一元函数 -TwoSingleVarsFunc: TypeAlias = Callable[[SingleVar, SingleVar], SingleVar] -TwoArraysFunc: TypeAlias = Callable[[ArrayVar, ArrayVar], ArrayVar] -TwoVarsFunc: TypeAlias = TwoSingleVarsFunc | TwoArraysFunc +TwoSingleVarsFunc: TypeAlias = Callable[[SingleVar, SingleVar], SingleVar] # 二元单变量函数 +TwoArraysFunc: TypeAlias = Callable[[ArrayVar, ArrayVar], ArrayVar] # 二元数组函数 +TwoVarsFunc: TypeAlias = TwoSingleVarsFunc | TwoArraysFunc # 二元函数 -ThreeSingleVarsFunc: TypeAlias = Callable[[SingleVar, SingleVar, SingleVar], SingleVar] -ThreeArraysFunc: TypeAlias = Callable[[ArrayVar, ArrayVar, ArrayVar], ArrayVar] -ThreeVarsFunc: TypeAlias = ThreeSingleVarsFunc | ThreeArraysFunc +ThreeSingleVarsFunc: TypeAlias = Callable[[SingleVar, SingleVar, SingleVar], SingleVar] # 三元单变量函数 +ThreeArraysFunc: TypeAlias = Callable[[ArrayVar, ArrayVar, ArrayVar], ArrayVar] # 三元数组函数 +ThreeVarsFunc: TypeAlias = ThreeSingleVarsFunc | ThreeArraysFunc # 三元函数 -MultiSingleVarsFunc: TypeAlias = Callable[..., SingleVar] -MultiArraysFunc: TypeAlias = Callable[..., ArrayVar] -MultiVarsFunc: TypeAlias = MultiSingleVarsFunc | MultiArraysFunc +MultiSingleVarsFunc: TypeAlias = Callable[..., SingleVar] # 多元单变量函数 +MultiArraysFunc: TypeAlias = Callable[..., ArrayVar] # 多元数组函数 +MultiVarsFunc: TypeAlias = MultiSingleVarsFunc | MultiArraysFunc # 多元函数