Skip to content

Commit

Permalink
Improved type hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaspuff committed Jun 12, 2018
1 parent 1064157 commit f2e16c1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ check_untyped_defs = True
disallow_subclassing_any = False
warn_redundant_casts = True
warn_return_any = True
warn_unused_ignores = True
warn_unused_ignores = False
strict_optional = True
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ coverage==4.5.1
docutils==0.14
execnet==1.5.0
jmespath==0.9.3
multidict==4.3.0
multidict==4.3.1
mypy==0.610
packaging==17.1
protobuf==3.5.2.post1
Expand Down
10 changes: 5 additions & 5 deletions tomodachi/transport/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
self._log_level = kwargs.get('log_level') if kwargs and kwargs.get('log_level') else 'INFO'


class RequestHandler(web_protocol.RequestHandler):
class RequestHandler(web_protocol.RequestHandler): # type: ignore
def __init__(self, *args: Any, **kwargs: Any) -> None:
self._server_header = kwargs.pop('server_header', None) if kwargs else None
self._access_log = kwargs.pop('access_log', None) if kwargs else None
Expand Down Expand Up @@ -110,7 +110,7 @@ def handle_error(self, request: Any, status: int=500, exc: Any=None, message: Op
return resp


class Server(web_server.Server):
class Server(web_server.Server): # type: ignore
def __init__(self, *args: Any, **kwargs: Any) -> None:
self._server_header = kwargs.pop('server_header', None) if kwargs else None
self._access_log = kwargs.pop('access_log', None) if kwargs else None
Expand All @@ -122,7 +122,7 @@ def __call__(self) -> RequestHandler:
**self._kwargs)


class DynamicResource(web_urldispatcher.DynamicResource):
class DynamicResource(web_urldispatcher.DynamicResource): # type: ignore
def __init__(self, pattern: Any, *, name: Optional[str]=None) -> None:
self._routes = [] # type: List
self._name = name
Expand Down Expand Up @@ -214,7 +214,7 @@ async def handler(request: web.Request) -> web.Response:
status = int(_status)
_returned_headers = return_value.get('headers')
if _returned_headers:
returned_headers = _returned_headers # type: Union[Mapping[str, Any], Iterable[Tuple[str]]]
returned_headers = _returned_headers # type: Union[Mapping[str, Any], Iterable[Tuple[str, Any]]]
headers = CIMultiDict(returned_headers)
elif isinstance(return_value, list) or isinstance(return_value, tuple):
_status = return_value[0]
Expand Down Expand Up @@ -309,7 +309,7 @@ async def handler(request: web.Request) -> web.Response:
status = int(_status)
_returned_headers = return_value.get('headers')
if _returned_headers:
returned_headers = _returned_headers # type: Union[Mapping[str, Any], Iterable[Tuple[str]]]
returned_headers = _returned_headers # type: Union[Mapping[str, Any], Iterable[Tuple[str, Any]]]
headers = CIMultiDict(returned_headers)
elif isinstance(return_value, list) or isinstance(return_value, tuple):
_status = return_value[0]
Expand Down

0 comments on commit f2e16c1

Please sign in to comment.