Fix third_party errors with --disallow-any-generics (#3278)

Part of #3267. Together with #3276 this should fix all such problems.
This commit is contained in:
Sebastian Rittau
2019-09-30 13:14:01 +02:00
committed by Jelle Zijlstra
parent 412b9e74d5
commit ed4b1de0ad
51 changed files with 244 additions and 263 deletions

View File

@@ -35,7 +35,7 @@ class FlagValues:
def is_gnu_getopt(self) -> bool: ...
IsGnuGetOpt = is_gnu_getopt
# TODO dict type
def FlagDict(self) -> dict: ...
def FlagDict(self) -> Dict[Any, Any]: ...
def flags_by_module_dict(self) -> Dict[str, List[Flag]]: ...
FlagsByModuleDict = flags_by_module_dict
def flags_by_module_id_dict(self) -> Dict[int, List[Flag]]: ...
@@ -206,7 +206,7 @@ def DEFINE_enum(name: str, default: Optional[str], enum_values: List[str], help:
class BaseListParser(ArgumentParser):
def __init__(self, token: str = ..., name: str = ...) -> None: ...
def Parse(self, argument: Any) -> list: ...
def Parse(self, argument: Any) -> List[Any]: ...
class ListParser(BaseListParser):
def __init__(self) -> None: ...

View File

@@ -1,16 +1,16 @@
from typing import Any
from typing import Any, Dict
from tornado.util import ObjectDict
from collections import namedtuple
class SSLError(Exception): ...
class _NormalizedHeaderCache(dict):
class _NormalizedHeaderCache(Dict[Any, Any]):
size: Any
queue: Any
def __init__(self, size) -> None: ...
def __missing__(self, key): ...
class HTTPHeaders(dict):
class HTTPHeaders(Dict[Any, Any]):
def __init__(self, *args, **kwargs) -> None: ...
def add(self, name, value): ...
def get_list(self, name): ...

View File

@@ -43,12 +43,9 @@ class AsyncHTTPSTestCase(AsyncHTTPTestCase):
def get_protocol(self): ...
@overload
def gen_test(*, timeout: Optional[float] = ...) -> Callable[[Callable[..., Generator]], Callable[..., None]]:
...
def gen_test(*, timeout: Optional[float] = ...) -> Callable[[Callable[..., Generator[Any, Any, Any]]], Callable[..., None]]: ...
@overload
def gen_test(func: Callable[..., Generator]) -> Callable[..., None]:
...
def gen_test(func: Callable[..., Generator[Any, Any, Any]]) -> Callable[..., None]: ...
class LogTrapTestCase(unittest.TestCase):
def run(self, result: Optional[Any] = ...): ...

View File

@@ -1,8 +1,8 @@
from typing import Any
from typing import Any, Dict
xrange: Any
class ObjectDict(dict):
class ObjectDict(Dict[Any, Any]):
def __getattr__(self, name): ...
def __setattr__(self, name, value): ...