Type annotation of zerver/models.py

[Substantially revised by tabbott]

This probably still has some bugs in it, but having mostly complete
annotations for models.py will help a lot for the annotations folks
are adding to other files.
This commit is contained in:
Ashish Kumar
2016-05-07 21:32:57 +05:30
committed by Tim Abbott
parent 37015fd7c5
commit 31bf6b8259
4 changed files with 106 additions and 8 deletions

View File

@@ -202,7 +202,7 @@ def generic_bulk_cached_fetch(cache_key_function, query_function, object_ids,
setter=lambda obj: obj,
id_fetcher=lambda obj: obj.id,
cache_transformer=lambda obj: obj):
# type: (Callable[[Any], str], Callable[[List[int]], List[Any]], List[Any], Callable[[Any], Any], Callable[[Any], Any], Callable[[Any], Any], Callable[[Any], Any]) -> Dict[int, Any]
# type: (Callable[[Any], str], Callable[[List[Any]], List[Any]], List[Any], Callable[[Any], Any], Callable[[Any], Any], Callable[[Any], Any], Callable[[Any], Any]) -> Dict[Any, Any]
cache_keys = {} # type: Dict[int, str]
for object_id in object_ids:
cache_keys[object_id] = cache_key_function(object_id)