From dcb2c5e2e64715c25538a05e6f967dd0f0fb84c8 Mon Sep 17 00:00:00 2001 From: Philipp Hahn Date: Tue, 4 Jan 2022 07:58:27 +0100 Subject: [PATCH] fix(checker): Change word[pos] initialization None breaks type checking in several places as those values must be checked for still not being None. --- enchant/checker/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enchant/checker/__init__.py b/enchant/checker/__init__.py index de3b7262..c55f0038 100644 --- a/enchant/checker/__init__.py +++ b/enchant/checker/__init__.py @@ -166,8 +166,8 @@ def __init__( tokenize = get_tokenizer(None, chunkers, filters) self._tokenize = tokenize - self.word: Optional[str] = None - self.wordpos: Optional[int] = None + self.word = "" + self.wordpos = 0 self._ignore_words: PythonDict[str, bool] = {} self._replace_words: PythonDict[str, str] = {} # Default to the empty string as the text to be checked