Skip to content

Commit

Permalink
Add path signature for async views. (#2085)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlost authored Apr 25, 2024
1 parent 3fe74d8 commit 5ef36c5
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion django-stubs/urls/conf.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Callable, Sequence
from types import ModuleType
from typing import Any, overload
from typing import Any, Coroutine, overload

from django.urls import URLPattern, URLResolver, _AnyURL
from django.utils.functional import _StrOrPromise
Expand All @@ -21,6 +21,13 @@ def path(
route: _StrOrPromise, view: Callable[..., HttpResponseBase], kwargs: dict[str, Any] = ..., name: str = ...
) -> URLPattern: ...
@overload
def path(
route: _StrOrPromise,
view: Callable[..., Coroutine[Any, Any, HttpResponseBase]],
kwargs: dict[str, Any] = ...,
name: str = ...,
) -> URLPattern: ...
@overload
def path(route: _StrOrPromise, view: IncludedURLConf, kwargs: dict[str, Any] = ..., name: str = ...) -> URLResolver: ...
@overload
def path(
Expand All @@ -33,6 +40,13 @@ def re_path(
route: _StrOrPromise, view: Callable[..., HttpResponseBase], kwargs: dict[str, Any] = ..., name: str = ...
) -> URLPattern: ...
@overload
def re_path(
route: _StrOrPromise,
view: Callable[..., Coroutine[Any, Any, HttpResponseBase]],
kwargs: dict[str, Any] = ...,
name: str = ...,
) -> URLPattern: ...
@overload
def re_path(
route: _StrOrPromise, view: IncludedURLConf, kwargs: dict[str, Any] = ..., name: str = ...
) -> URLResolver: ...
Expand Down

0 comments on commit 5ef36c5

Please sign in to comment.