Run mypy in python 3 mode.
This still picks up the 2.7 type annotations in comments. Fix the compute_quadratic signature to allow for the ValuewView of an OrderedDict in python 3.
This commit is contained in:
@@ -9,7 +9,7 @@ from __future__ import absolute_import
|
||||
from cdsl import next_power_of_two
|
||||
|
||||
try:
|
||||
from typing import Any, List, Sequence, Callable # noqa
|
||||
from typing import Any, List, Iterable, Callable # noqa
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
@@ -32,7 +32,7 @@ def simple_hash(s):
|
||||
|
||||
|
||||
def compute_quadratic(items, hash_function):
|
||||
# type: (Sequence[Any], Callable[[Any], int]) -> List[Any]
|
||||
# type: (Iterable[Any], Callable[[Any], int]) -> List[Any]
|
||||
"""
|
||||
Compute an open addressed, quadratically probed hash table containing
|
||||
`items`. The returned table is a list containing the elements of the
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
[mypy]
|
||||
python_version = 2.7
|
||||
disallow_untyped_defs = True
|
||||
warn_unused_ignores = True
|
||||
warn_return_any = True
|
||||
|
||||
Reference in New Issue
Block a user