mypy: Wrap return value in Optional.

This commit is contained in:
Eklavya Sharma 2017-05-23 17:09:12 -07:00 committed by Tim Abbott
parent cc1937c8d5
commit 7636972a6c
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ from __future__ import print_function
from collections import defaultdict
from typing import Callable, DefaultDict, Iterator, List, Set, Tuple
from typing import Callable, DefaultDict, Iterator, List, Optional, Set, Tuple
Edge = Tuple[str, str]
EdgeSet = Set[Edge]
@ -87,7 +87,7 @@ class Graph(object):
print(tup)
def best_edge_to_remove(orig_graph, is_exempt):
# type: (Graph, Callable[[Edge], bool]) -> Edge
# type: (Graph, Callable[[Edge], bool]) -> Optional[Edge]
# expects an already reduced graph as input
orig_edges = orig_graph.edges()

View File

@ -223,7 +223,7 @@ class BaseWebsocketHandler(WebSocketHandler):
self.client = None # type: Any
def get(self, *args, **kwargs):
# type: (*Any, **Any) -> Callable
# type: (*Any, **Any) -> Optional[Callable]
# use get method from WebsocketHandler
return super(BaseWebsocketHandler, self).get(*args, **kwargs)