zerver/lib/narrow.py: Fix annotations.

This commit is contained in:
Eklavya Sharma 2016-07-04 01:53:14 +05:30
parent 95b6e668a7
commit 192663edcf
1 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,7 @@
from zerver.lib.request import JsonableError
from django.utils.translation import ugettext as _
from typing import Iterable, Sequence, Callable, Dict
from typing import Any, Callable, Iterable, Mapping, Sequence
from six import text_type
@ -13,9 +13,10 @@ def check_supported_events_narrow_filter(narrow):
raise JsonableError(_("Operator %s not supported.") % (operator,))
def build_narrow_filter(narrow):
# type: (Iterable[Sequence[text_type]]) -> Callable[[Dict[text_type, text_type]], bool]
# type: (Iterable[Sequence[text_type]]) -> Callable[[Mapping[str, Any]], bool]
check_supported_events_narrow_filter(narrow)
def narrow_filter(event):
# type: (Mapping[str, Any]) -> bool
message = event["message"]
flags = event["flags"]
for element in narrow: