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
... I got the below type error when calling path with the async view:
No overloads for "path" match the provided arguments Pyright[reportGeneralTypeIssues](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportGeneralTypeIssues)
conf.pyi(26, 5): Overload 3 is the closest match
Argument of type "() -> Coroutine[Any, Any, HttpResponse]" cannot be assigned to parameter "view" of type "Sequence[URLResolver | str]" in function "path"
"function" is incompatible with "Sequence[URLResolver | str]"Pyright[reportGeneralTypeIssues](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportGeneralTypeIssues)
def async_view()
Full name: adit.dicom_explorer.urls.async_view
(function) def async_view() -> Coroutine[Any, Any, HttpResponse]
I used the latest pyright version (not tested with mypy).
How it should be
path function should accept an async function based view.
System information
OS:
python version: 3.11
django version: 4.27
pyright version: 1.1.339
django-stubs version: 4.2.7
django-stubs-ext version: 4.2.7
The text was updated successfully, but these errors were encountered:
Just to complete things ... I also tested this with mypy v1.7.1, and it also gives me a type error there:
Argument 2 to "path" has incompatible type "Callable[[], Coroutine[Any, Any, HttpResponseBase]]"; expected "Callable[..., HttpResponseBase]" [arg-type]
As a side note, django-types (from which I tried to switch) does not seem to have this problem.
Bug report
What's wrong
When using the below snippet ...
... I got the below type error when calling
path
with the async view:I used the latest pyright version (not tested with mypy).
How it should be
path
function should accept an async function based view.System information
python
version: 3.11django
version: 4.27pyright
version: 1.1.339django-stubs
version: 4.2.7django-stubs-ext
version: 4.2.7The text was updated successfully, but these errors were encountered: