Skip to content

Commit

Permalink
doc[checker]: PEP-484 get_text -> Any
Browse files Browse the repository at this point in the history
get_text() -> Union[str, array] depending on what was used when
set_text() was used.
Because of <python/mypy#1693> use Any.
  • Loading branch information
pmhahn committed Jan 6, 2022
1 parent ab721b3 commit ecb27d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enchant/checker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import array
import warnings
from typing import Dict as PythonDict
from typing import List, MutableSequence, Optional, Type, Union
from typing import Any, List, MutableSequence, Optional, Type, Union

import enchant
from enchant import Dict
Expand Down Expand Up @@ -201,7 +201,7 @@ def set_text(self, text: str) -> None:
self._use_tostring = False
self._tokens = self._tokenize(self._text)

def get_text(self) -> str:
def get_text(self) -> Any:
"""Return the spell-checked text."""
if self._use_tostring:
return self._array_to_string(self._text)
Expand Down

0 comments on commit ecb27d2

Please sign in to comment.