mypy: Introduce strict definition of Validator into types.py.

This commit is contained in:
neiljp (Neil Pilgrim)
2018-03-16 05:22:14 +00:00
committed by Tim Abbott
parent 99bae7fa5d
commit b79c3840da

View File

@@ -1,4 +1,8 @@
from typing import TypeVar, Callable
from typing import TypeVar, Callable, Optional
from django.http import HttpResponse
ViewFuncT = TypeVar('ViewFuncT', bound=Callable[..., HttpResponse])
# See zerver/lib/validator.py for more details of Validators,
# including many examples
Validator = Callable[[str, object], Optional[str]]