diff options
| author | 2023-12-05 15:05:17 +0800 | |
|---|---|---|
| committer | 2023-12-05 15:05:17 +0800 | |
| commit | a5f3f08f9ae4465b723ed827c72dada74fdb473c (patch) | |
| tree | 63a2ef6c3b633c7027c492b2c514fcea52a0c7e2 /src/hydrorollcore/rule.py | |
| parent | c10c8237470b5edb6a383e557324fab06fc8d855 (diff) | |
| download | infini-a5f3f08f9ae4465b723ed827c72dada74fdb473c.tar.gz infini-a5f3f08f9ae4465b723ed827c72dada74fdb473c.zip | |
:rocket: 优化抽象基类 修复部分声明异常
Diffstat (limited to 'src/hydrorollcore/rule.py')
| -rw-r--r-- | src/hydrorollcore/rule.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/hydrorollcore/rule.py b/src/hydrorollcore/rule.py index eb4b92cd..a7e5d9a7 100644 --- a/src/hydrorollcore/rule.py +++ b/src/hydrorollcore/rule.py @@ -14,16 +14,12 @@ class RuleLoadType(Enum): class Rule(metaclass=ABCMeta): + """规则基类""" + @abstractmethod def __init__(self): - pass - - @classmethod - def __subclasshook__(cls, other): - if cls is Rule: - return hasattr(other, "run") and callable(getattr(other, "run")) - return NotImplemented + raise NotImplementedError @abstractmethod async def run(self): - pass + raise NotImplementedError |
