lol
This commit is contained in:
@@ -6,6 +6,7 @@ from . import typing as ft
|
||||
from .globals import current_app
|
||||
from .globals import request
|
||||
|
||||
F = t.TypeVar("F", bound=t.Callable[..., t.Any])
|
||||
|
||||
http_method_funcs = frozenset(
|
||||
["get", "post", "head", "options", "delete", "put", "trace", "patch"]
|
||||
@@ -60,7 +61,7 @@ class View:
|
||||
#: decorator.
|
||||
#:
|
||||
#: .. versionadded:: 0.8
|
||||
decorators: t.ClassVar[list[t.Callable]] = []
|
||||
decorators: t.ClassVar[list[t.Callable[[F], F]]] = []
|
||||
|
||||
#: Create a new instance of this view class for every request by
|
||||
#: default. If a view subclass sets this to ``False``, the same
|
||||
@@ -106,13 +107,13 @@ class View:
|
||||
self = view.view_class( # type: ignore[attr-defined]
|
||||
*class_args, **class_kwargs
|
||||
)
|
||||
return current_app.ensure_sync(self.dispatch_request)(**kwargs)
|
||||
return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]
|
||||
|
||||
else:
|
||||
self = cls(*class_args, **class_kwargs)
|
||||
|
||||
def view(**kwargs: t.Any) -> ft.ResponseReturnValue:
|
||||
return current_app.ensure_sync(self.dispatch_request)(**kwargs)
|
||||
return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]
|
||||
|
||||
if cls.decorators:
|
||||
view.__name__ = name
|
||||
@@ -187,4 +188,4 @@ class MethodView(View):
|
||||
meth = getattr(self, "get", None)
|
||||
|
||||
assert meth is not None, f"Unimplemented method {request.method!r}"
|
||||
return current_app.ensure_sync(meth)(**kwargs)
|
||||
return current_app.ensure_sync(meth)(**kwargs) # type: ignore[no-any-return]
|
||||
|
||||
Reference in New Issue
Block a user