Make mypy a bit stricter

This commit is contained in:
Kovid Goyal
2020-03-05 19:57:28 +05:30
parent 81a58186c6
commit 77e9460eea
11 changed files with 74 additions and 53 deletions

View File

@@ -260,11 +260,12 @@ class Table:
self.layout_dirty = True
def is_index(w):
with suppress(Exception):
def is_index(w: str) -> bool:
try:
int(w.lstrip(INDEX_CHAR), 16)
return True
return False
except Exception:
return False
class UnicodeInput(Handler):