Skip to content

Commit

Permalink
Add ModuleType as a possible type to URLResolver.urlconf_name (#1891
Browse files Browse the repository at this point in the history
)

* 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)

* Update resolvers.pyi

* Remove `None` as a possible value
  • Loading branch information
Viicos committed Dec 27, 2023
1 parent 6330a5b commit 8118c23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django-stubs/urls/resolvers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class URLPattern:

class URLResolver:
pattern: _Pattern
urlconf_name: str | None | Sequence[_AnyURL]
urlconf_name: str | Sequence[_AnyURL] | ModuleType
callback: None
default_kwargs: dict[str, Any]
namespace: str | None
Expand All @@ -112,7 +112,7 @@ class URLResolver:
def __init__(
self,
pattern: _Pattern,
urlconf_name: str | None | Sequence[_AnyURL],
urlconf_name: str | Sequence[_AnyURL] | ModuleType,
default_kwargs: dict[str, Any] | None = ...,
app_name: str | None = ...,
namespace: str | None = ...,
Expand Down

0 comments on commit 8118c23

Please sign in to comment.