You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
..../urls.py:70:9 - error: Argument of type "AsView[GenericView]" cannot be assigned to parameter "view" of type "Sequence[URLResolver | str]" in function "path"
"AsView[GenericView]" is incompatible with "Sequence[URLResolver | str]" (reportGeneralTypeIssues)
How is that should be
Since it works the types should also be compatible right?!
The first signature with view: Callable[..., HttpResponseBase] should match AsView[GenericView], because AsView.__call__ is defined as the _View typevar, which in this case is GenericView.
And GenericView's __call__ signature def __call__(self, request: HttpRequest, *args: Any, **kwargs: Any) -> Response should be compatible with the callable.
This works in my projects with mypy. If you figure out why pyright doesn't agree with this chain of reasoning, we might be able to come up with a fix or work-around.
Bug report
What's wrong
For this line:
path("auth-test/", apitest.AuthTest.as_view()),
we get the following type error:
How is that should be
Since it works the types should also be compatible right?!
System information
python
version: Python 3.11.6django
version: 4.2.7pyright
version: pyright 1.1.336django-stubs
version:The text was updated successfully, but these errors were encountered: