We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mypy throws an error overriding the signature of the get method, as it is described only for synchronous execution.
error: Signature of "get" incompatible with supertype "HTTPMethodView" [override] note: Superclass: note: Callable[..., Any] | None note: Subclass: note: def get(self, request: Request[Any, Any]) -> Coroutine[Any, Any, HTTPResponse]
I suggest changing the description of the get method /sanic/views.py to:
get: Union[Callable[..., Any], Coroutine[..., Any], None]
No response
As a script (app.run or Sanic.serve)
app.run
Sanic.serve
Linux
23.12.0
The text was updated successfully, but these errors were encountered:
PR welcome 😉
Sorry, something went wrong.
That did not solve the problem for me. mypy still complains and I have no idea why.
mypy
It works if None is removed from the type definition.
None
get: Union[Callable[..., Any], Coroutine[..., Any]]
I cannot explain this behavior.
No branches or pull requests
Is there an existing issue for this?
Describe the bug
Mypy throws an error overriding the signature of the get method, as it is described only for synchronous execution.
I suggest changing the description of the get method /sanic/views.py to:
Code snippet
No response
Expected Behavior
No response
How do you run Sanic?
As a script (
app.run
orSanic.serve
)Operating System
Linux
Sanic Version
23.12.0
Additional context
No response
The text was updated successfully, but these errors were encountered: