Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions third_party/2/gflags.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]]: ...
Expand Down Expand Up @@ -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: ...
Expand Down
6 changes: 3 additions & 3 deletions third_party/2/tornado/httputil.pyi
Original file line number Diff line number Diff line change
@@ -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): ...
Expand Down
7 changes: 2 additions & 5 deletions third_party/2/tornado/testing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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] = ...): ...
Expand Down
4 changes: 2 additions & 2 deletions third_party/2/tornado/util.pyi
Original file line number Diff line number Diff line change
@@ -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): ...

Expand Down
20 changes: 11 additions & 9 deletions third_party/2and3/atomicwrites/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from typing import AnyStr, Callable, ContextManager, IO, Optional, Text, Type
from typing import Any, AnyStr, Callable, ContextManager, Generic, IO, Optional, Text, Type, Union

def replace_atomic(src: AnyStr, dst: AnyStr) -> None: ...
def move_atomic(src: AnyStr, dst: AnyStr) -> None: ...
class AtomicWriter(object):
def __init__(self, path: AnyStr, mode: Text = ..., overwrite: bool = ...) -> None: ...
def open(self) -> ContextManager[IO]: ...
def _open(self, get_fileobject: Callable) -> ContextManager[IO]: ...
def get_fileobject(self, dir: Optional[AnyStr] = ..., **kwargs) -> IO: ...
def sync(self, f: IO) -> None: ...
def commit(self, f: IO) -> None: ...
def rollback(self, f: IO) -> None: ...
def atomic_write(path: AnyStr, writer_cls: Type[AtomicWriter] = ..., **cls_kwargs: object) -> ContextManager[IO]: ...
def __init__(self, path: Union[Text, bytes], mode: Text = ..., overwrite: bool = ...) -> None: ...
def open(self) -> ContextManager[IO[Any]]: ...
def _open(self, get_fileobject: Callable[..., IO[AnyStr]]) -> ContextManager[IO[AnyStr]]: ...
Comment thread
srittau marked this conversation as resolved.
def get_fileobject(self, dir: Union[None, Text, bytes] = ..., **kwargs: Any) -> IO[Any]: ...
def sync(self, f: IO[Any]) -> None: ...
def commit(self, f: IO[Any]) -> None: ...
def rollback(self, f: IO[Any]) -> None: ...
def atomic_write(
path: Union[Text, bytes], writer_cls: Type[AtomicWriter] = ..., **cls_kwargs: object,
) -> ContextManager[IO[Any]]: ...
4 changes: 2 additions & 2 deletions third_party/2and3/boto/s3/cors.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Optional
from typing import Any, List, Optional

class CORSRule:
allowed_method: Any
Expand All @@ -12,7 +12,7 @@ class CORSRule:
def endElement(self, name, value, connection): ...
def to_xml(self) -> str: ...

class CORSConfiguration(list):
class CORSConfiguration(List[CORSRule]):
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def to_xml(self) -> str: ...
Expand Down
6 changes: 3 additions & 3 deletions third_party/2and3/boto/s3/lifecycle.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Optional
from typing import Any, List, Optional

class Rule:
id: Any
Expand Down Expand Up @@ -26,7 +26,7 @@ class Transition:
def __init__(self, days: Optional[Any] = ..., date: Optional[Any] = ..., storage_class: Optional[Any] = ...) -> None: ...
def to_xml(self): ...

class Transitions(list):
class Transitions(List[Transition]):
transition_properties: int
current_transition_property: int
temp_days: Any
Expand All @@ -44,7 +44,7 @@ class Transitions(list):
@property
def storage_class(self): ...

class Lifecycle(list):
class Lifecycle(List[Rule]):
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def to_xml(self): ...
Expand Down
6 changes: 3 additions & 3 deletions third_party/2and3/boto/s3/tagging.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Optional
from typing import Any, List, Optional

class Tag:
key: Any
Expand All @@ -9,13 +9,13 @@ class Tag:
def to_xml(self): ...
def __eq__(self, other): ...

class TagSet(list):
class TagSet(List[Tag]):
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def add_tag(self, key, value): ...
def to_xml(self): ...

class Tags(list):
class Tags(List[TagSet]):
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def to_xml(self): ...
Expand Down
6 changes: 3 additions & 3 deletions third_party/2and3/boto/s3/website.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Optional
from typing import Any, List, Optional

def tag(key, value): ...

Expand Down Expand Up @@ -27,8 +27,8 @@ class RedirectLocation(_XMLKeyValue):
def __init__(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ...) -> None: ...
def to_xml(self): ...

class RoutingRules(list):
def add_rule(self, rule): ...
class RoutingRules(List[RoutingRule]):
def add_rule(self, rule: RoutingRule) -> RoutingRules: ...
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def to_xml(self): ...
Expand Down
6 changes: 3 additions & 3 deletions third_party/2and3/boto/utils.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def get_instance_metadata(
data: str = ...,
timeout: Optional[int] = ...,
num_retries: int = ...,
) -> Optional[LazyLoadMetadata]: ...
) -> Optional[LazyLoadMetadata[Any, Any]]: ...
def get_instance_identity(
version: str = ...,
url: str = ...,
Expand Down Expand Up @@ -138,7 +138,7 @@ class ShellCommand:
cwd: Optional[subprocess._TXT] = ...,
) -> None: ...

process: subprocess.Popen
process: subprocess.Popen[Any]

def run(self, cwd: Optional[subprocess._CMD] = ...) -> Optional[int]: ...
def setReadOnly(self, value) -> None: ...
Expand Down Expand Up @@ -204,7 +204,7 @@ def notify(
append_instance_id: bool = ...,
) -> None: ...
def get_utf8_value(value: str) -> bytes: ...
def mklist(value: Any) -> List: ...
def mklist(value: Any) -> List[Any]: ...
def pythonize_name(name: str) -> str: ...
def write_mime_multipart(
content: List[Tuple[str, str]],
Expand Down
4 changes: 2 additions & 2 deletions third_party/2and3/characteristic/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Sequence, Callable, Union, Any, Optional, AnyStr, TypeVar, Type
from typing import Sequence, Callable, Union, Any, Optional, AnyStr, TypeVar, Type, Dict

def with_repr(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ...
def with_cmp(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ...
Expand All @@ -18,7 +18,7 @@ def attributes(
apply_with_repr: bool = ...,
apply_immutable: bool = ...,
store_attributes: Optional[Callable[[type, Attribute], Any]] = ...,
**kw: Optional[dict]) -> Callable[[Type[_T]], Type[_T]]: ...
**kw: Optional[Dict[Any, Any]]) -> Callable[[Type[_T]], Type[_T]]: ...

class Attribute:
def __init__(
Expand Down
43 changes: 16 additions & 27 deletions third_party/2and3/click/core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ from typing import (
from click.formatting import HelpFormatter
from click.parser import OptionParser

_CC = TypeVar("_CC", bound=Callable[[], Any])

def invoke_param_callback(
callback: Callable[[Context, Parameter, Optional[str]], Any],
ctx: Context,
Expand All @@ -45,7 +47,7 @@ class Context:
parent: Optional[Context]
command: Command
info_name: Optional[str]
params: Dict
params: Dict[Any, Any]
args: List[str]
protected_args: List[str]
obj: Any
Expand All @@ -62,7 +64,7 @@ class Context:
auto_envvar_prefix: Optional[str]
color: Optional[bool]
_meta: Dict[str, Any]
_close_callbacks: List
_close_callbacks: List[Any]
_depth: int

def __init__(
Expand Down Expand Up @@ -99,8 +101,7 @@ class Context:
def make_formatter(self) -> HelpFormatter:
...

def call_on_close(self, f: Callable) -> Callable:
...
def call_on_close(self, f: _CC) -> _CC: ...

def close(self) -> None:
...
Expand Down Expand Up @@ -132,25 +133,16 @@ class Context:
def get_help(self) -> str:
...

def invoke(
self, callback: Union[Command, Callable], *args, **kwargs
) -> Any:
...

def forward(
self, callback: Union[Command, Callable], *args, **kwargs
) -> Any:
...
def invoke(self, callback: Union[Command, Callable[..., Any]], *args, **kwargs) -> Any: ...
def forward(self, callback: Union[Command, Callable[..., Any]], *args, **kwargs) -> Any: ...

class BaseCommand:
allow_extra_args: bool
allow_interspersed_args: bool
ignore_unknown_options: bool
name: str
context_settings: Dict

def __init__(self, name: str, context_settings: Optional[Dict] = ...) -> None:
...
context_settings: Dict[Any, Any]
def __init__(self, name: str, context_settings: Optional[Dict[Any, Any]] = ...) -> None: ...

def get_usage(self, ctx: Context) -> str:
...
Expand Down Expand Up @@ -184,7 +176,7 @@ class BaseCommand:


class Command(BaseCommand):
callback: Optional[Callable]
callback: Optional[Callable[..., Any]]
params: List[Parameter]
help: Optional[str]
epilog: Optional[str]
Expand All @@ -197,8 +189,8 @@ class Command(BaseCommand):
def __init__(
self,
name: str,
context_settings: Optional[Dict] = ...,
callback: Optional[Callable] = ...,
context_settings: Optional[Dict[Any, Any]] = ...,
callback: Optional[Callable[..., Any]] = ...,
params: Optional[List[Parameter]] = ...,
help: Optional[str] = ...,
epilog: Optional[str] = ...,
Expand Down Expand Up @@ -257,7 +249,7 @@ class MultiCommand(Command):
invoke_without_command: bool
subcommand_metavar: str
chain: bool
result_callback: Callable
result_callback: Callable[..., Any]

def __init__(
self,
Expand All @@ -266,7 +258,7 @@ class MultiCommand(Command):
no_args_is_help: Optional[bool] = ...,
subcommand_metavar: Optional[str] = ...,
chain: bool = ...,
result_callback: Optional[Callable] = ...,
result_callback: Optional[Callable[..., Any]] = ...,
**attrs
) -> None:
...
Expand Down Expand Up @@ -302,11 +294,8 @@ class Group(MultiCommand):
def add_command(self, cmd: Command, name: Optional[str] = ...):
...

def command(self, *args, **kwargs) -> Callable[[Callable], Command]:
...

def group(self, *args, **kwargs) -> Callable[[Callable], Group]:
...
def command(self, *args, **kwargs) -> Callable[[Callable[..., Any]], Command]: ...
def group(self, *args, **kwargs) -> Callable[[Callable[..., Any]], Group]: ...


class CommandCollection(MultiCommand):
Expand Down
12 changes: 4 additions & 8 deletions third_party/2and3/click/decorators.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,15 @@ def command(
name: Optional[str] = ...,
cls: Optional[Type[Command]] = ...,
# Command
context_settings: Optional[Dict] = ...,
context_settings: Optional[Dict[Any, Any]] = ...,
help: Optional[str] = ...,
epilog: Optional[str] = ...,
short_help: Optional[str] = ...,
options_metavar: str = ...,
add_help_option: bool = ...,
hidden: bool = ...,
deprecated: bool = ...,
) -> Callable[[Callable], Command]:
...

) -> Callable[[Callable[..., Any]], Command]: ...

# This inherits attrs from Group, MultiCommand and Command.

Expand All @@ -59,7 +57,7 @@ def group(
no_args_is_help: Optional[bool] = ...,
subcommand_metavar: Optional[str] = ...,
chain: bool = ...,
result_callback: Optional[Callable] = ...,
result_callback: Optional[Callable[..., Any]] = ...,
# Command
help: Optional[str] = ...,
epilog: Optional[str] = ...,
Expand All @@ -70,9 +68,7 @@ def group(
deprecated: bool = ...,
# User-defined
**kwargs: Any,
) -> Callable[[Callable], Group]:
...

) -> Callable[[Callable[..., Any]], Group]: ...

def argument(
*param_decls: str,
Expand Down
7 changes: 2 additions & 5 deletions third_party/2and3/click/exceptions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ class ClickException(Exception):
class UsageError(ClickException):
ctx: Optional[Context]

def __init__(self, message: str, ctx: Optional[Context] = ...) -> None:
...

def show(self, file: Optional[IO] = ...) -> None:
...
def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: ...
def show(self, file: Optional[IO[Any]] = ...) -> None: ...


class BadParameter(UsageError):
Expand Down
Loading