From ca03a05b7914edaac4a5994e1f6563d5513f56f9 Mon Sep 17 00:00:00 2001 From: Kleber Noel <42589399+klebster2@users.noreply.github.com> Date: Sun, 3 Nov 2024 00:29:16 +0000 Subject: [PATCH] lint --- python/plugin.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/python/plugin.py b/python/plugin.py index 70b0abe..96c3aab 100644 --- a/python/plugin.py +++ b/python/plugin.py @@ -88,9 +88,7 @@ def get_synonyms(self, word: str) -> t.List[t.Dict[str, t.Any]]: if isinstance(synset, wn.Synset): for lemma in synset.lemmas(): if lemma.lower() != word.lower(): - synset_definition: str | None = ( - synset.definition() - ) # pylint: disable=unsupported-assignment-operation + synset_definition: t.Optional[str] = synset.definition() if synset_definition is None: synset_definition = "" _item = self.format_completion_item( @@ -107,9 +105,7 @@ def get_hyponyms(self, word: str) -> t.List[t.Dict[str, t.Any]]: for synset in self.get_synsets(word): # pylint: disable=no-value-for-parameter for hyponym in synset.hyponyms(): for lemma in hyponym.lemmas(): - hyponym_definition: str | None = ( - hyponym.definition() - ) # pylint: disable=unsupported-assignment-operation + hyponym_definition: t.Optional[str] = hyponym.definition() if hyponym_definition is None: hyponym_definition = "" @@ -128,7 +124,7 @@ def get_meronyms(self, word: str) -> t.List[t.Dict[str, t.Any]]: # Get both part and substance meronyms for meronym in synset.meronyms(): for lemma in meronym.lemmas(): - meronym_definition: str | None = ( + meronym_definition: t.Optional[str] = ( meronym.definition() ) # pylint: disable=unsupported-assignment-operation if meronym_definition is None: