Skip to content

Commit ea16b44

Browse files
dnetpre-commit-ci[bot]sobolevn
authored
base.pyi: use base class HttpResponseBase (typeddjango#2459)
* base.pyi: use base class HttpResponseBase Previously, this was only a `Callable` but 125f31a restricted the last parameter to `HttpResponse` which is unnecessarily strict, as it does not cover things like `StreamingHttpResponse` and its descendant `FileResponse` among others – while _view_ functions can return these as well. They have a common base class `HttpResponseBase` – I guess this would be a better choice here. * [pre-commit.ci] auto fixes from pre-commit.com hooks * Update django-stubs/urls/base.pyi --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: sobolevn <[email protected]>
1 parent 2b3b079 commit ea16b44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

django-stubs/urls/base.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from collections.abc import Callable, Sequence
22
from typing import Any, Literal
33

4-
from django.http.response import HttpResponse
4+
from django.http.response import HttpResponseBase
55
from django.urls.resolvers import ResolverMatch
66

77
def resolve(path: str, urlconf: str | None = ...) -> ResolverMatch: ...
88
def reverse(
9-
viewname: Callable[..., HttpResponse] | str | None,
9+
viewname: Callable[..., HttpResponseBase] | str | None,
1010
urlconf: str | None = ...,
1111
args: Sequence[Any] | None = ...,
1212
kwargs: dict[str, Any] | None = ...,

0 commit comments

Comments
 (0)