Skip to content

Commit dc836bc

Browse files
committed
rules: add more type hint for match and parse
1 parent cc8005f commit dc836bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sopel/plugins/rules.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import logging
2525
import re
2626
import threading
27-
from typing import Type, TypeVar
27+
from typing import Generator, Iterable, Type, TypeVar
2828
from urllib.parse import urlparse
2929

3030

@@ -596,7 +596,7 @@ def get_output_prefix(self) -> str:
596596
"""
597597

598598
@abc.abstractmethod
599-
def match(self, bot, pretrigger):
599+
def match(self, bot, pretrigger) -> Iterable:
600600
"""Match a pretrigger according to the rule.
601601
602602
:param bot: Sopel instance
@@ -678,7 +678,7 @@ def is_global_rate_limited(self) -> bool:
678678
"""
679679

680680
@abc.abstractmethod
681-
def parse(self, text):
681+
def parse(self, text) -> Generator:
682682
"""Parse ``text`` and yield matches.
683683
684684
:param str text: text to parse by the rule

0 commit comments

Comments
 (0)