Consistently use '= ...' for optional parameters.

This commit is contained in:
Matthias Kramm
2015-11-09 13:55:00 -08:00
parent 375bf063b1
commit 94c9ce8fd0
278 changed files with 2085 additions and 2085 deletions

View File

@@ -61,36 +61,36 @@ class AbstractEventLoop(metaclass=ABCMeta):
# Network I/O methods returning Futures.
@abstractmethod
def getaddrinfo(self, host: str, port: int, *,
family: int = 0, type: int = 0, proto: int = 0, flags: int = 0) -> List[Tuple[int, int, int, str, tuple]]: ...
family: int = ..., type: int = ..., proto: int = ..., flags: int = ...) -> List[Tuple[int, int, int, str, tuple]]: ...
@abstractmethod
def getnameinfo(self, sockaddr: tuple, flags: int = 0) -> Tuple[str, int]: ...
def getnameinfo(self, sockaddr: tuple, flags: int = ...) -> Tuple[str, int]: ...
@abstractmethod
def create_connection(self, protocol_factory: Any, host: str = None, port: int = None, *,
ssl: Any = None, family: int = 0, proto: int = 0, flags: int = 0, sock: Any = None,
local_addr: str = None, server_hostname: str = None) -> tuple: ...
def create_connection(self, protocol_factory: Any, host: str = ..., port: int = ..., *,
ssl: Any = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: Any = ...,
local_addr: str = ..., server_hostname: str = ...) -> tuple: ...
# ?? check Any
# return (Transport, Protocol)
@abstractmethod
def create_server(self, protocol_factory: Any, host: str = None, port: int = None, *,
family: int = AF_UNSPEC, flags: int = AI_PASSIVE,
sock: Any = None, backlog: int = 100, ssl: Any = None, reuse_address: Any = None) -> Any: ...
def create_server(self, protocol_factory: Any, host: str = ..., port: int = ..., *,
family: int = ..., flags: int = ...,
sock: Any = ..., backlog: int = ..., ssl: Any = ..., reuse_address: Any = ...) -> Any: ...
# ?? check Any
# return Server
@abstractmethod
def create_unix_connection(self, protocol_factory: Any, path: str, *,
ssl: Any = None, sock: Any = None,
server_hostname: str = None) -> tuple: ...
ssl: Any = ..., sock: Any = ...,
server_hostname: str = ...) -> tuple: ...
# ?? check Any
# return tuple(Transport, Protocol)
@abstractmethod
def create_unix_server(self, protocol_factory: Any, path: str, *,
sock: Any = None, backlog: int = 100, ssl: Any = None) -> Any: ...
sock: Any = ..., backlog: int = ..., ssl: Any = ...) -> Any: ...
# ?? check Any
# return Server
@abstractmethod
def create_datagram_endpoint(self, protocol_factory: Any,
local_addr: str = None, remote_addr: str = None, *,
family: int = 0, proto: int = 0, flags: int = 0) -> tuple: ...
local_addr: str = ..., remote_addr: str = ..., *,
family: int = ..., proto: int = ..., flags: int = ...) -> tuple: ...
#?? check Any
# return (Transport, Protocol)
# Pipes and subprocesses.
@@ -103,14 +103,14 @@ class AbstractEventLoop(metaclass=ABCMeta):
#?? check Any
# return (Transport, Protocol)
@abstractmethod
def subprocess_shell(self, protocol_factory: Any, cmd: Union[bytes, str], *, stdin: Any = PIPE,
stdout: Any = PIPE, stderr: Any = PIPE,
def subprocess_shell(self, protocol_factory: Any, cmd: Union[bytes, str], *, stdin: Any = ...,
stdout: Any = ..., stderr: Any = ...,
**kwargs: Dict[str, Any]) -> tuple: ...
#?? check Any
# return (Transport, Protocol)
@abstractmethod
def subprocess_exec(self, protocol_factory: Any, *args: List[Any], stdin: Any = PIPE,
stdout: Any = PIPE, stderr: Any = PIPE,
def subprocess_exec(self, protocol_factory: Any, *args: List[Any], stdin: Any = ...,
stdout: Any = ..., stderr: Any = ...,
**kwargs: Dict[str, Any]) -> tuple: ...
#?? check Any
# return (Transport, Protocol)

View File

@@ -23,7 +23,7 @@ class Future(Iterator[_T], Generic[_T]):
_blocking = False
_log_traceback = False
_tb_logger = _TracebackLogger
def __init__(self, *, loop: AbstractEventLoop = None) -> None: ...
def __init__(self, *, loop: AbstractEventLoop = ...) -> None: ...
def __repr__(self) -> str: ...
def __del__(self) -> None: ...
def cancel(self) -> bool: ...

View File

@@ -14,7 +14,7 @@ class QueueFull(Exception): ...
T = TypeVar('T')
class Queue(Generic[T]):
def __init__(self, maxsize: int = 0, *, loop: AbstractEventLoop = None) -> None: ...
def __init__(self, maxsize: int = ..., *, loop: AbstractEventLoop = ...) -> None: ...
def _init(self, maxsize: int) -> None: ...
def _get(self) -> T: ...
def _put(self, item: T) -> None: ...

View File

@@ -15,24 +15,24 @@ FIRST_COMPLETED = 'FIRST_COMPLETED'
ALL_COMPLETED = 'ALL_COMPLETED'
_T = TypeVar('_T')
def coroutine(f: _T) -> _T: ... # Here comes and go a function
def sleep(delay: float, result: _T = None, loop: AbstractEventLoop = None) -> Future[_T]: ...
def wait(fs: List[Task[_T]], *, loop: AbstractEventLoop = None,
timeout: float = None, return_when: str = ALL_COMPLETED) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ...
def wait_for(fut: Future[_T], timeout: float, *, loop: AbstractEventLoop = None) -> Future[_T]: ...
def sleep(delay: float, result: _T = ..., loop: AbstractEventLoop = ...) -> Future[_T]: ...
def wait(fs: List[Task[_T]], *, loop: AbstractEventLoop = ...,
timeout: float = ..., return_when: str = ...) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ...
def wait_for(fut: Future[_T], timeout: float, *, loop: AbstractEventLoop = ...) -> Future[_T]: ...
class Task(Future[_T], Generic[_T]):
_all_tasks = None # type: Set[Task]
_current_tasks = {} # type: Dict[AbstractEventLoop, Task]
@classmethod
def current_task(cls, loop: AbstractEventLoop = None) -> Task: ...
def current_task(cls, loop: AbstractEventLoop = ...) -> Task: ...
@classmethod
def all_tasks(cls, loop: AbstractEventLoop = None) -> Set[Task]: ...
def __init__(self, coro: Future[_T], *, loop: AbstractEventLoop = None) -> None: ...
def all_tasks(cls, loop: AbstractEventLoop = ...) -> Set[Task]: ...
def __init__(self, coro: Future[_T], *, loop: AbstractEventLoop = ...) -> None: ...
def __repr__(self) -> str: ...
def get_stack(self, *, limit: int = None) -> List[Any]: ... # return List[stackframe]
def print_stack(self, *, limit: int = None, file: TextIO = None) -> None: ...
def get_stack(self, *, limit: int = ...) -> List[Any]: ... # return List[stackframe]
def print_stack(self, *, limit: int = ..., file: TextIO = ...) -> None: ...
def cancel(self) -> bool: ...
def _step(self, value: Any = None, exc: Exception = None) -> None: ...
def _step(self, value: Any = ..., exc: Exception = ...) -> None: ...
def _wakeup(self, future: Future[Any]) -> None: ...