This commit is contained in:
jxxghp
2024-05-10 20:09:45 +08:00
parent 3d5761157a
commit 0e9e626ab6
2 changed files with 17 additions and 9 deletions

View File

@ -13,9 +13,9 @@ class ModuleHelper:
"""
@classmethod
def load(cls, package_path, filter_func=lambda name, obj: True):
def load(cls, package_path: str, filter_func=lambda name, obj: True):
"""
导入模块
导入模块
:param package_path: 父包名
:param filter_func: 子模块过滤函数入参为模块名和模块对象返回True则导入否则不导入
:return:
@ -41,7 +41,7 @@ class ModuleHelper:
return submodules
@classmethod
def load_with_pre_filter(cls, package_path, filter_func=lambda name, obj: True):
def load_with_pre_filter(cls, package_path: str, filter_func=lambda name, obj: True):
"""
导入子模块
:param package_path: 父包名