Skip to content

Commit e63ced2

Browse files
hukkinj1matejcik
authored andcommitted
Require explicit Optional in type annotations
1 parent ae726b3 commit e63ced2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.mypy.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ disallow_untyped_defs = True
99
check_untyped_defs = True
1010
strict_equality = True
1111
implicit_reexport = False
12+
no_implicit_optional = True
1213

1314
[mypy-generate_vectors]
1415
ignore_errors = True

mnemonic/mnemonic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import hmac
2626
import itertools
2727
import os
28-
from typing import AnyStr, List, Sequence, TypeVar, Union
28+
from typing import AnyStr, List, Optional, Sequence, TypeVar, Union
2929
import unicodedata
3030

3131
_T = TypeVar("_T")
@@ -41,7 +41,7 @@ def binary_search(
4141
a: Sequence[_T],
4242
x: _T,
4343
lo: int = 0,
44-
hi: int = None, # can't use a to specify default for hi
44+
hi: Optional[int] = None, # can't use a to specify default for hi
4545
) -> int:
4646
hi = hi if hi is not None else len(a) # hi defaults to len(a)
4747
pos = bisect.bisect_left(a, x, lo, hi) # find insertion position

0 commit comments

Comments
 (0)