From b66727657dbd412543994a51741062686c699c36 Mon Sep 17 00:00:00 2001 From: Anthony Ricaud Date: Fri, 17 May 2019 18:40:40 +0100 Subject: [PATCH] Type non-parametrised views.decorators.http (#80) Fixes `error: Untyped decorator makes function "view" untyped` --- django-stubs/views/decorators/http.pyi | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/django-stubs/views/decorators/http.pyi b/django-stubs/views/decorators/http.pyi index 1829946..1edc5f7 100644 --- a/django-stubs/views/decorators/http.pyi +++ b/django-stubs/views/decorators/http.pyi @@ -1,15 +1,12 @@ from typing import Any, Callable, List, Optional, TypeVar -conditional_page: Any - -def require_http_methods(request_method_list: List[str]) -> Callable: ... - -require_GET: Any -require_POST: Any -require_safe: Any - _F = TypeVar("_F", bound=Callable[..., Any]) +def conditional_page(_F) -> _F: ... +def require_http_methods(request_method_list: List[str]) -> Callable: ... +def require_GET(_F) -> _F: ... +def require_POST(_F) -> _F: ... +def require_safe(_F) -> _F: ... def condition(etag_func: Optional[Callable] = ..., last_modified_func: Optional[Callable] = ...) -> Callable: ... def etag(etag_func: Callable[..., Any]) -> Callable[[_F], _F]: ... def last_modified(last_modified_func: Callable[..., Any]) -> Callable[[_F], _F]: ...