11from collections .abc import Callable , Sequence
22from types import ModuleType
3- from typing import Any , overload
3+ from typing import Any , Coroutine , overload
44
55from django .urls import URLPattern , URLResolver , _AnyURL
66from django .utils .functional import _StrOrPromise
@@ -21,6 +21,13 @@ def path(
2121 route : _StrOrPromise , view : Callable [..., HttpResponseBase ], kwargs : dict [str , Any ] = ..., name : str = ...
2222) -> URLPattern : ...
2323@overload
24+ def path (
25+ route : _StrOrPromise ,
26+ view : Callable [..., Coroutine [Any , Any , HttpResponseBase ]],
27+ kwargs : dict [str , Any ] = ...,
28+ name : str = ...,
29+ ) -> URLPattern : ...
30+ @overload
2431def path (route : _StrOrPromise , view : IncludedURLConf , kwargs : dict [str , Any ] = ..., name : str = ...) -> URLResolver : ...
2532@overload
2633def path (
@@ -33,6 +40,13 @@ def re_path(
3340 route : _StrOrPromise , view : Callable [..., HttpResponseBase ], kwargs : dict [str , Any ] = ..., name : str = ...
3441) -> URLPattern : ...
3542@overload
43+ def re_path (
44+ route : _StrOrPromise ,
45+ view : Callable [..., Coroutine [Any , Any , HttpResponseBase ]],
46+ kwargs : dict [str , Any ] = ...,
47+ name : str = ...,
48+ ) -> URLPattern : ...
49+ @overload
3650def re_path (
3751 route : _StrOrPromise , view : IncludedURLConf , kwargs : dict [str , Any ] = ..., name : str = ...
3852) -> URLResolver : ...
0 commit comments