Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type hints of converters in urls.resolvers #1892

Merged
merged 1 commit into from
Dec 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions django-stubs/urls/resolvers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ from typing import Any, overload

from django.core.checks.messages import CheckMessage
from django.urls import _AnyURL
from django.urls.converters import UUIDConverter
from django.utils.datastructures import MultiValueDict
from django.utils.functional import cached_property
from typing_extensions import TypeAlias
Expand Down Expand Up @@ -59,22 +58,22 @@ class CheckURLMixin:
class RegexPattern(CheckURLMixin):
regex: LocaleRegexDescriptor
name: str | None
converters: dict[Any, Any]
converters: dict[str, Any]
def __init__(self, regex: str, name: str | None = ..., is_endpoint: bool = ...) -> None: ...
def match(self, path: str) -> tuple[str, tuple, dict[str, str]] | None: ...
def check(self) -> list[CheckMessage]: ...

class RoutePattern(CheckURLMixin):
regex: LocaleRegexDescriptor
name: str | None
converters: dict[str, UUIDConverter]
converters: dict[str, Any]
def __init__(self, route: str, name: str | None = ..., is_endpoint: bool = ...) -> None: ...
def match(self, path: str) -> tuple[str, tuple, dict[str, int | str]] | None: ...
def check(self) -> list[CheckMessage]: ...

class LocalePrefixPattern:
prefix_default_language: bool
converters: dict[Any, Any]
converters: dict[str, Any]
def __init__(self, prefix_default_language: bool = ...) -> None: ...
@property
def regex(self) -> Pattern[str]: ...
Expand Down