summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaz Solc <tomaz.solc@tablix.org>2021-02-05 14:08:01 +0100
committerTomaz Solc <tomaz.solc@tablix.org>2021-02-05 14:09:05 +0100
commitf8775394b421eaf47cb7c13eb1cc187550b3183c (patch)
tree0556685821442f199b4214254b59969674296bbc
parent4ee4df1c3cc5e3d774c2115140613f057b2e455a (diff)
downloadunidecode-f8775394b421eaf47cb7c13eb1cc187550b3183c.tar.gz
Remove __init__.pyi
-rw-r--r--setup.py2
-rw-r--r--unidecode/__init__.py8
-rw-r--r--unidecode/__init__.pyi6
3 files changed, 5 insertions, 11 deletions
diff --git a/setup.py b/setup.py
index 2cfbac0..f327f8a 100644
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@ setup(
author_email='tomaz.solc@tablix.org',
packages=['unidecode'],
- package_data={'unidecode': ['py.typed', '__init__.pyi']},
+ package_data={'unidecode': ['py.typed']},
python_requires=">=3.5",
test_suite='tests',
diff --git a/unidecode/__init__.py b/unidecode/__init__.py
index e019972..5633c45 100644
--- a/unidecode/__init__.py
+++ b/unidecode/__init__.py
@@ -17,9 +17,9 @@ A standard string object will be returned. If you need bytes, use:
b'Knosos'
"""
import warnings
-from typing import Optional
+from typing import Dict, Optional, Sequence
-Cache = {}
+Cache = {} # type: Dict[int, Optional[Sequence[Optional[str]]]]
class UnidecodeError(ValueError):
def __init__(self, message: str, index: Optional[int] = None) -> None:
@@ -78,7 +78,7 @@ def unidecode_expect_nonascii(string: str, errors: str = 'ignore', replace_str:
unidecode = unidecode_expect_ascii
-def _get_repl_str(char):
+def _get_repl_str(char: str) -> Optional[str]:
codepoint = ord(char)
if codepoint < 0x80:
@@ -114,7 +114,7 @@ def _get_repl_str(char):
else:
return None
-def _unidecode(string, errors, replace_str):
+def _unidecode(string: str, errors: str, replace_str:str) -> str:
retval = []
for index, char in enumerate(string):
diff --git a/unidecode/__init__.pyi b/unidecode/__init__.pyi
deleted file mode 100644
index e3889ca..0000000
--- a/unidecode/__init__.pyi
+++ /dev/null
@@ -1,6 +0,0 @@
-from typing import Any, Dict, Optional, Sequence
-
-Cache: Dict[int, Optional[Sequence[Optional[str]]]]
-
-class UnidecodeError(ValueError):
- index: Optional[int] = ...