From 3b789110d9a2e542b530223a7bf64c93fcfa864a Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Mon, 25 Dec 2023 09:24:09 +0100 Subject: [PATCH 1/3] Add `ModuleType` as a possile type to `URLResolver.urlconf_name` According to code comment: It may also be an object with an urlpatterns attribute (i.e. a module object) --- django-stubs/urls/resolvers.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-stubs/urls/resolvers.pyi b/django-stubs/urls/resolvers.pyi index f7ca6db39..14e72ca13 100644 --- a/django-stubs/urls/resolvers.pyi +++ b/django-stubs/urls/resolvers.pyi @@ -103,7 +103,7 @@ class URLPattern: class URLResolver: pattern: _Pattern - urlconf_name: str | None | Sequence[_AnyURL] + urlconf_name: str | None | Sequence[_AnyURL] | ModuleType callback: None default_kwargs: dict[str, Any] namespace: str | None From 082322a65e83b5c07d0dfcaad64343ee0b229693 Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Mon, 25 Dec 2023 09:40:58 +0100 Subject: [PATCH 2/3] Update resolvers.pyi --- django-stubs/urls/resolvers.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-stubs/urls/resolvers.pyi b/django-stubs/urls/resolvers.pyi index 14e72ca13..fd0ebf212 100644 --- a/django-stubs/urls/resolvers.pyi +++ b/django-stubs/urls/resolvers.pyi @@ -113,7 +113,7 @@ class URLResolver: def __init__( self, pattern: _Pattern, - urlconf_name: str | None | Sequence[_AnyURL], + urlconf_name: str | None | Sequence[_AnyURL] | ModuleType, default_kwargs: dict[str, Any] | None = ..., app_name: str | None = ..., namespace: str | None = ..., From 2b5c42bfa917ef524c335b124ce4cdfed17545b3 Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Wed, 27 Dec 2023 15:04:32 +0100 Subject: [PATCH 3/3] Remove `None` as a possible value --- django-stubs/urls/resolvers.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django-stubs/urls/resolvers.pyi b/django-stubs/urls/resolvers.pyi index fd0ebf212..f2c9a0a32 100644 --- a/django-stubs/urls/resolvers.pyi +++ b/django-stubs/urls/resolvers.pyi @@ -103,7 +103,7 @@ class URLPattern: class URLResolver: pattern: _Pattern - urlconf_name: str | None | Sequence[_AnyURL] | ModuleType + urlconf_name: str | Sequence[_AnyURL] | ModuleType callback: None default_kwargs: dict[str, Any] namespace: str | None @@ -113,7 +113,7 @@ class URLResolver: def __init__( self, pattern: _Pattern, - urlconf_name: str | None | Sequence[_AnyURL] | ModuleType, + urlconf_name: str | Sequence[_AnyURL] | ModuleType, default_kwargs: dict[str, Any] | None = ..., app_name: str | None = ..., namespace: str | None = ...,