From edfbb7bcfb44e073cbf8d37ad76dfa28b1c01612 Mon Sep 17 00:00:00 2001 From: John Franey <1728528+johnfraney@users.noreply.github.com> Date: Mon, 20 Jan 2025 14:24:00 -0400 Subject: [PATCH] fix: feedback from PR --- pyproject.toml | 4 ++-- src/textblob/base.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e52d64bd..7ec6c96f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,6 +86,7 @@ select = [ "I", # isort "UP", # pyupgrade "W", # pycodestyle warning + "TC", # flake8-typechecking ] [tool.ruff.lint.per-file-ignores] @@ -98,5 +99,4 @@ markers = [ ] [tool.pyright] -include = ["src/**"] -exclude = ["tests/**"] +include = ["src/**", "tests/**"] diff --git a/src/textblob/base.py b/src/textblob/base.py index 36c59612..602d9525 100644 --- a/src/textblob/base.py +++ b/src/textblob/base.py @@ -29,7 +29,7 @@ def tag(self, text: str, tokenize=True) -> list[tuple[str, str]]: """Return a list of tuples of the form (word, tag) for a given set of text or BaseBlob instance. """ - raise NotImplementedError("Subclass must implement a tag method") + ... ##### NOUN PHRASE EXTRACTORS ##### @@ -44,7 +44,7 @@ class BaseNPExtractor(metaclass=ABCMeta): @abstractmethod def extract(self, text: str) -> list[str]: """Return a list of noun phrases (strings) for a body of text.""" - raise NotImplementedError("Subclass must implement an extract method") + ... ##### TOKENIZERS ##### @@ -62,7 +62,7 @@ def tokenize(self, text: str) -> list[str]: :rtype: list """ - raise NotImplementedError("Subclasss must implement tokenize method") + ... def itokenize(self, text: str, *args, **kwargs): """Return a generator that generates tokens "on-demand". @@ -121,4 +121,4 @@ class BaseParser(metaclass=ABCMeta): @abstractmethod def parse(self, text: AnyStr): """Parses the text.""" - raise NotImplementedError("Subclass must implement a parse method") + ...