|
1 | | -from collections.abc import Callable, Sequence |
2 | | -from typing import Any, Literal |
| 1 | +from collections.abc import Callable, Mapping, Sequence |
| 2 | +from typing import Any, Literal, TypeAlias |
3 | 3 |
|
| 4 | +from django.http.request import QueryDict |
4 | 5 | from django.http.response import HttpResponseBase |
5 | 6 | from django.urls.resolvers import ResolverMatch |
6 | 7 |
|
| 8 | +# https://github.com/python/typeshed/blob/87f599dc8312ac67b941b5f2b47274534a1a2d3a/stdlib/urllib/parse.pyi#L136-L138 |
| 9 | +_QueryType: TypeAlias = ( |
| 10 | + Mapping[Any, Any] | Mapping[Any, Sequence[Any]] | Sequence[tuple[Any, Any]] | Sequence[tuple[Any, Sequence[Any]]] |
| 11 | +) |
| 12 | + |
7 | 13 | def resolve(path: str, urlconf: str | None = ...) -> ResolverMatch: ... |
8 | 14 | def reverse( |
9 | 15 | viewname: Callable[..., HttpResponseBase] | str | None, |
10 | 16 | urlconf: str | None = ..., |
11 | 17 | args: Sequence[Any] | None = ..., |
12 | 18 | kwargs: dict[str, Any] | None = ..., |
13 | 19 | current_app: str | None = ..., |
| 20 | + *, |
| 21 | + query: QueryDict | _QueryType | None = ..., |
| 22 | + fragment: str | None = ..., |
14 | 23 | ) -> str: ... |
15 | 24 |
|
16 | 25 | reverse_lazy: Any |
|
0 commit comments