From 39659c752884ae31ccc14bbe247f3918f97bab9c Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Thu, 16 Mar 2017 16:50:41 +1300 Subject: Make mypy succeed with imports on master.py We get little benefit from our mypy QA checks at the moment, because we skip imports. This patch is what's needed to make mypy succeed with imports on a single file: master.py It also updates mypy to the current version, and enables a QA check. Mypy bugs I encountered: dict.update with kwargs not supported: https://github.com/python/mypy/issues/1031 property setters and getters must be adjacent: https://github.com/python/mypy/issues/1465 --- mitmproxy/utils/typecheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mitmproxy/utils') diff --git a/mitmproxy/utils/typecheck.py b/mitmproxy/utils/typecheck.py index e8e2121e..5df4ea4b 100644 --- a/mitmproxy/utils/typecheck.py +++ b/mitmproxy/utils/typecheck.py @@ -1,7 +1,7 @@ import typing -def check_type(name: str, value: typing.Any, typeinfo: type) -> None: +def check_type(name: str, value: typing.Any, typeinfo: typing.Any) -> None: """ This function checks if the provided value is an instance of typeinfo and raises a TypeError otherwise. -- cgit v1.2.3