Skip to content

Commit

Permalink
Fix type hints of converters in urls.resolvers (#1892)
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos authored Dec 25, 2023
1 parent 560bdab commit 8e9484d
Showing 1 changed file with 3 additions and 4 deletions.
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

0 comments on commit 8e9484d

Please sign in to comment.