From bf0b3d95f5602c3405f023e63fc9621f73f2f2ce Mon Sep 17 00:00:00 2001 From: yupix Date: Fri, 10 May 2024 10:21:51 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=87=E5=AD=97=E5=88=97=E3=81=AE?= =?UTF-8?q?=E9=95=B7=E3=81=95=E3=82=92=E7=A2=BA=E8=AA=8D=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=9F=E3=82=81=E3=81=AE=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mipac/utils/util.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mipac/utils/util.py b/mipac/utils/util.py index 644f526..2dde58c 100644 --- a/mipac/utils/util.py +++ b/mipac/utils/util.py @@ -62,6 +62,26 @@ class DeprecatedClass: return Wrapped +def check_char_length_least(char: str | list[str], length: int) -> bool: + """指定した文字列の長さが指定した長さ以上かをboolで返します + + Parameters + ---------- + char : str | list[str] + 確認したい文字列 + length : int + 指定した長さ + + Returns + ------- + bool + 指定した長さ以上の場合はTrue, それ以外はFalse + """ + if isinstance(char, str): + return len(char) >= length + return all(len(i) >= length for i in char) + + def deprecated(func): """指定した関数が非推奨であることを示す為のデコレータ"""