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:
Jakob Stoklund Olesen
2017-05-08 12:54:09 -07:00
parent 1818bb18b5
commit aecd90a1b9
2 changed files with 2 additions and 3 deletions

View File

@@ -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

View File

@@ -1,5 +1,4 @@
[mypy]
python_version = 2.7
disallow_untyped_defs = True
warn_unused_ignores = True
warn_return_any = True