Skip to content

Commit

Permalink
rules: add more type hint for match and parse
Browse files Browse the repository at this point in the history
  • Loading branch information
Exirel committed Aug 29, 2021
1 parent d053712 commit 9f83a59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sopel/plugins/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import logging
import re
import threading
from typing import Type, TypeVar
from typing import Generator, Iterable, Type, TypeVar
from urllib.parse import urlparse


Expand Down Expand Up @@ -596,7 +596,7 @@ def get_output_prefix(self) -> str:
"""

@abc.abstractmethod
def match(self, bot, pretrigger):
def match(self, bot, pretrigger) -> Iterable:
"""Match a pretrigger according to the rule.
:param bot: Sopel instance
Expand Down Expand Up @@ -678,7 +678,7 @@ def is_global_rate_limited(self) -> bool:
"""

@abc.abstractmethod
def parse(self, text):
def parse(self, text) -> Generator:
"""Parse ``text`` and yield matches.
:param str text: text to parse by the rule
Expand Down

0 comments on commit 9f83a59

Please sign in to comment.