Skip to content

Commit

Permalink
Type non-parametrised views.decorators.http (typeddjango#80)
Browse files Browse the repository at this point in the history
Fixes `error: Untyped decorator makes function "view" untyped`
  • Loading branch information
rik authored and mkurnikov committed May 17, 2019
1 parent 86642e3 commit b667276
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions django-stubs/views/decorators/http.pyi
Original file line number Diff line number Diff line change
@@ -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]: ...

0 comments on commit b667276

Please sign in to comment.