mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Fix Flask stubs for dispatch_request (#2796)
`dispatch_request` can accept arbitrary arguments and can return different values. To keep this simple and in line with the rest of the stubs (e.g. with `view_func: Callable[..., Any]`), `Any` is used for the return value although it is too broad. Closes #2795.
This commit is contained in:
committed by
Sebastian Rittau
parent
d275e73e1f
commit
2bd16c42f6
4
third_party/2and3/flask/views.pyi
vendored
4
third_party/2and3/flask/views.pyi
vendored
@@ -11,7 +11,7 @@ class View:
|
||||
methods: Any = ...
|
||||
provide_automatic_options: Any = ...
|
||||
decorators: Any = ...
|
||||
def dispatch_request(self) -> None: ...
|
||||
def dispatch_request(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
@classmethod
|
||||
def as_view(cls, name: Any, *class_args: Any, **class_kwargs: Any): ...
|
||||
|
||||
@@ -19,4 +19,4 @@ class MethodViewType(type):
|
||||
def __init__(cls, name: Any, bases: Any, d: Any) -> None: ...
|
||||
|
||||
class MethodView(View, metaclass=MethodViewType):
|
||||
def dispatch_request(self, *args: Any, **kwargs: Any): ...
|
||||
def dispatch_request(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user