Move tornado to 2and3 (#3780)

This also uses a trick to avoid `Incompatible with supertype` errors for `get()` etc. that used to have signature like `def get(*args, **kwars): ...` (that btw is used in tornado itself, see https://github.com/tornadoweb/tornado/blob/master/tornado/web.py#L266).
This commit is contained in:
Ivan Levkivskyi
2020-02-26 22:53:48 +00:00
committed by GitHub
parent 6d33cf3382
commit ca1ca0c14f
14 changed files with 17 additions and 9 deletions

View File

@@ -1,4 +1,6 @@
from typing import Any
import sys
from typing import Any, Callable, Optional
from tornado import httputil
MIN_SUPPORTED_SIGNED_VALUE_VERSION: Any
@@ -6,6 +8,12 @@ MAX_SUPPORTED_SIGNED_VALUE_VERSION: Any
DEFAULT_SIGNED_VALUE_VERSION: Any
DEFAULT_SIGNED_VALUE_MIN_VERSION: Any
if sys.version_info[:2] >= (3, 5):
from typing import Awaitable
_MethodType = Callable[..., Optional[Awaitable[None]]]
else:
_MethodType = Callable[..., Any]
class RequestHandler:
SUPPORTED_METHODS: Any
application: Any
@@ -14,16 +22,16 @@ class RequestHandler:
path_kwargs: Any
ui: Any
def __init__(self, application, request, **kwargs) -> None: ...
def initialize(self): ...
initialize: Callable[..., None] = ...
@property
def settings(self): ...
def head(self, *args, **kwargs): ...
def get(self, *args, **kwargs): ...
def post(self, *args, **kwargs): ...
def delete(self, *args, **kwargs): ...
def patch(self, *args, **kwargs): ...
def put(self, *args, **kwargs): ...
def options(self, *args, **kwargs): ...
head: _MethodType
get: _MethodType
post: _MethodType
delete: _MethodType
patch: _MethodType
put: _MethodType
options: _MethodType
def prepare(self): ...
def on_finish(self): ...
def on_connection_close(self): ...