Files
Morgan Bartholomew 5209c256e9 [python] PY-80529 sync bundled django-stubs to 5.2.2
GitOrigin-RevId: 3a93ac3253fb47e532a5eb02bcc1ce328d0b1078
2025-07-25 13:27:06 +00:00

56 lines
1.8 KiB
Python

from collections.abc import Callable, Coroutine, Sequence
from types import ModuleType
from typing import Any, TypeAlias, overload
from django.urls import URLPattern, URLResolver, _AnyURL
from django.utils.functional import _StrOrPromise
from ..http.response import HttpResponseBase
_URLConf: TypeAlias = str | ModuleType | Sequence[_AnyURL]
_IncludedURLConf: TypeAlias = tuple[Sequence[URLResolver | URLPattern], str | None, str | None]
def include(arg: _URLConf | tuple[_URLConf, str], namespace: str | None = ...) -> _IncludedURLConf: ...
# path()
@overload
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(
route: _StrOrPromise, view: Sequence[URLResolver | str], kwargs: dict[str, Any] = ..., name: str = ...
) -> URLResolver: ...
# re_path()
@overload
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: ...
@overload
def re_path(
route: _StrOrPromise, view: Sequence[URLResolver | str], kwargs: dict[str, Any] = ..., name: str = ...
) -> URLResolver: ...