refactor : BaseFactory 基类类型自动推导 + 移除冗余代码

- _validate_component 从 BaseFactory[T] 泛型参数自动解析基类类型,9 个子类覆写移除
- Registry 类内联到 BaseFactory._entries,移除未用的 list_by_category/list_by_priority
- _component_base 在 __init_subclass__ 时立即解析
- 数据集 4 个子类冗余 __init__ 移除
This commit is contained in:
2026-06-06 21:23:41 +08:00
parent 9e31d4ef2b
commit e7b18b7c03
11 changed files with 78 additions and 219 deletions
+1 -1
View File
@@ -291,7 +291,7 @@ def test_sectioned_text_too_short(test_tokenizer):
def test_factory_registered():
names = MaskBuilderFactory._registry.list_names()
names = MaskBuilderFactory.list_registered()
assert "sectioned" in names