Change more defaults to ... (#1727)

This commit is contained in:
Jelle Zijlstra
2017-11-09 10:32:17 -08:00
committed by Matthias Kramm
parent fd25e534ad
commit 324f1761f4
20 changed files with 99 additions and 99 deletions

View File

@@ -264,14 +264,14 @@ class str(Sequence[str]):
def lower(self) -> str: ...
def lstrip(self, chars: Optional[str] = ...) -> str: ...
def partition(self, sep: str) -> Tuple[str, str, str]: ...
def replace(self, old: str, new: str, count: int = -1) -> str: ...
def replace(self, old: str, new: str, count: int = ...) -> str: ...
def rfind(self, sub: str, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ...
def rindex(self, sub: str, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ...
def rjust(self, width: int, fillchar: str = ...) -> str: ...
def rpartition(self, sep: str) -> Tuple[str, str, str]: ...
def rsplit(self, sep: Optional[str] = ..., maxsplit: int = -1) -> List[str]: ...
def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ...
def rstrip(self, chars: Optional[str] = ...) -> str: ...
def split(self, sep: Optional[str] = ..., maxsplit: int = -1) -> List[str]: ...
def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ...
def splitlines(self, keepends: bool = ...) -> List[str]: ...
def startswith(self, prefix: Union[str, Tuple[str, ...]], start: Optional[int] = ...,
end: Optional[int] = ...) -> bool: ...
@@ -350,7 +350,7 @@ class bytes(ByteString):
def lower(self) -> bytes: ...
def lstrip(self, chars: Optional[bytes] = ...) -> bytes: ...
def partition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
def replace(self, old: bytes, new: bytes, count: int = -1) -> bytes: ...
def replace(self, old: bytes, new: bytes, count: int = ...) -> bytes: ...
if sys.version_info >= (3, 3):
def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
else:
@@ -361,9 +361,9 @@ class bytes(ByteString):
def rindex(self, sub: bytes, start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
def rjust(self, width: int, fillchar: bytes = ...) -> bytes: ...
def rpartition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = -1) -> List[bytes]: ...
def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ...
def rstrip(self, chars: Optional[bytes] = ...) -> bytes: ...
def split(self, sep: Optional[bytes] = ..., maxsplit: int = -1) -> List[bytes]: ...
def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ...
def splitlines(self, keepends: bool = ...) -> List[bytes]: ...
def startswith(self, prefix: Union[bytes, Tuple[bytes, ...]]) -> bool: ...
def strip(self, chars: Optional[bytes] = ...) -> bytes: ...
@@ -442,7 +442,7 @@ class bytearray(MutableSequence[int], ByteString):
def lower(self) -> bytearray: ...
def lstrip(self, chars: Optional[bytes] = ...) -> bytearray: ...
def partition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
def replace(self, old: bytes, new: bytes, count: int = -1) -> bytearray: ...
def replace(self, old: bytes, new: bytes, count: int = ...) -> bytearray: ...
if sys.version_info >= (3, 3):
def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
else:
@@ -453,9 +453,9 @@ class bytearray(MutableSequence[int], ByteString):
def rindex(self, sub: bytes, start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
def rjust(self, width: int, fillchar: bytes = ...) -> bytearray: ...
def rpartition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = -1) -> List[bytearray]: ...
def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ...
def rstrip(self, chars: Optional[bytes] = ...) -> bytearray: ...
def split(self, sep: Optional[bytes] = ..., maxsplit: int = -1) -> List[bytearray]: ...
def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ...
def splitlines(self, keepends: bool = ...) -> List[bytearray]: ...
def startswith(self, prefix: bytes) -> bool: ...
def strip(self, chars: Optional[bytes] = ...) -> bytearray: ...
@@ -587,13 +587,13 @@ class list(MutableSequence[_T], Generic[_T]):
def copy(self) -> List[_T]: ...
def append(self, object: _T) -> None: ...
def extend(self, iterable: Iterable[_T]) -> None: ...
def pop(self, index: int = -1) -> _T: ...
def pop(self, index: int = ...) -> _T: ...
def index(self, object: _T, start: int = ..., stop: int = ...) -> int: ...
def count(self, object: _T) -> int: ...
def insert(self, index: int, object: _T) -> None: ...
def remove(self, object: _T) -> None: ...
def reverse(self) -> None: ...
def sort(self, *, key: Optional[Callable[[_T], Any]] = None, reverse: bool = ...) -> None: ...
def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T]: ...
@@ -744,9 +744,9 @@ class range(Sequence[int]):
def __reversed__(self) -> Iterator[int]: ...
class property:
def __init__(self, fget: Optional[Callable[[Any], Any]] = None,
fset: Optional[Callable[[Any, Any], None]] = None,
fdel: Optional[Callable[[Any], None]] = None,
def __init__(self, fget: Optional[Callable[[Any], Any]] = ...,
fset: Optional[Callable[[Any, Any], None]] = ...,
fdel: Optional[Callable[[Any], None]] = ...,
doc: Optional[str] = ...) -> None: ...
def getter(self, fget: Callable[[Any], Any]) -> property: ...
def setter(self, fset: Callable[[Any, Any], None]) -> property: ...
@@ -774,8 +774,8 @@ def delattr(o: Any, name: str) -> None: ...
def dir(o: object = ...) -> List[str]: ...
_N = TypeVar('_N', int, float)
def divmod(a: _N, b: _N) -> Tuple[_N, _N]: ...
def eval(source: Union[str, bytes, CodeType], globals: Optional[Dict[str, Any]] = None, locals: Optional[Mapping[str, Any]] = None) -> Any: ...
def exec(object: Union[str, bytes, CodeType], globals: Optional[Dict[str, Any]] = None, locals: Optional[Mapping[str, Any]] = None) -> Any: ...
def eval(source: Union[str, bytes, CodeType], globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> Any: ...
def exec(object: Union[str, bytes, CodeType], globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> Any: ...
def exit(code: Any = ...) -> NoReturn: ...
@overload
def filter(function: Optional[Callable[[_T], Any]],
@@ -826,15 +826,15 @@ if sys.version_info >= (3, 6):
class _PathLike(Generic[AnyStr]):
def __fspath__(self) -> AnyStr: ...
def open(file: Union[str, bytes, int, _PathLike], mode: str = ..., buffering: int = -1, encoding: Optional[str] = ...,
def open(file: Union[str, bytes, int, _PathLike], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...) -> IO[Any]: ...
else:
def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = -1, encoding: Optional[str] = ...,
def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...) -> IO[Any]: ...
def ord(c: Union[str, bytes, bytearray]) -> int: ...
# TODO: in Python 3.2, print() does not support flush
def print(*values: Any, sep: str = ..., end: str = ..., file: Optional[IO[str]] = None, flush: bool = ...) -> None: ...
def print(*values: Any, sep: str = ..., end: str = ..., file: Optional[IO[str]] = ..., flush: bool = ...) -> None: ...
@overload
def pow(x: int, y: int) -> Any: ... # The return type can be int or float, depending on y
@overload
@@ -859,7 +859,7 @@ def round(number: SupportsRound[_T]) -> _T: ...
def round(number: SupportsRound[_T], ndigits: int) -> _T: ...
def setattr(object: Any, name: str, value: Any) -> None: ...
def sorted(iterable: Iterable[_T], *,
key: Optional[Callable[[_T], Any]] = None,
key: Optional[Callable[[_T], Any]] = ...,
reverse: bool = ...) -> List[_T]: ...
@overload
def sum(iterable: Iterable[_T]) -> Union[_T, int]: ...
@@ -886,7 +886,7 @@ def zip(iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any],
iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any],
*iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ...
def __import__(name: str, globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ...,
fromlist: List[str] = ..., level: int = -1) -> Any: ...
fromlist: List[str] = ..., level: int = ...) -> Any: ...
# Ellipsis

View File

@@ -140,7 +140,7 @@ class ConfigParser(RawConfigParser):
allow_no_value: bool = ...,
delimiters: Sequence[str] = ...,
comment_prefixes: Sequence[str] = ...,
inline_comment_prefixes: Optional[Sequence[str]] = None,
inline_comment_prefixes: Optional[Sequence[str]] = ...,
strict: bool = ...,
empty_lines_in_values: bool = ...,
default_section: str = ...,

View File

@@ -195,7 +195,7 @@ class datetime:
def timetz(self) -> _time: ...
def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,
minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:
Optional[_tzinfo] = None) -> datetime: ...
Optional[_tzinfo] = ...) -> datetime: ...
def astimezone(self, tz: Optional[_tzinfo] = ...) -> datetime: ...
def ctime(self) -> str: ...
if sys.version_info >= (3, 6):

View File

@@ -4,8 +4,8 @@ import sys
import types
from typing import Any, Mapping, Optional, Sequence
def __import__(name: str, globals: Optional[Mapping[str, Any]] = None,
locals: Optional[Mapping[str, Any]] = None,
def __import__(name: str, globals: Optional[Mapping[str, Any]] = ...,
locals: Optional[Mapping[str, Any]] = ...,
fromlist: Sequence[str] = ...,
level: int = ...) -> types.ModuleType: ...

View File

@@ -19,7 +19,7 @@ class Finder(metaclass=ABCMeta):
# easier to simply ignore that this method exists.
# @abstractmethod
# def find_module(self, fullname: str,
# path: Optional[Sequence[_Path]] = None) -> Optional[Loader]: ...
# path: Optional[Sequence[_Path]] = ...) -> Optional[Loader]: ...
class ResourceLoader(Loader):
@abstractmethod

View File

@@ -35,7 +35,7 @@ if sys.version_info >= (3, 4):
def spec_from_file_location(
name: str, location: str, *,
loader: Optional[importlib.abc.Loader] = ...,
submodule_search_locations: Optional[List[str]] = None
submodule_search_locations: Optional[List[str]] = ...
) -> importlib.machinery.ModuleSpec: ...
if sys.version_info >= (3, 5):

View File

@@ -18,11 +18,11 @@ class JSONDecoder:
strict = ... # type: bool
object_pairs_hook = ... # type: Callable[[List[Tuple[str, Any]]], Any]
def __init__(self, object_hook: Optional[Callable[[Dict[str, Any]], Any]] = None,
parse_float: Optional[Callable[[str], Any]] = None,
parse_int: Optional[Callable[[str], Any]] = None,
parse_constant: Optional[Callable[[str], Any]] = None,
def __init__(self, object_hook: Optional[Callable[[Dict[str, Any]], Any]] = ...,
parse_float: Optional[Callable[[str], Any]] = ...,
parse_int: Optional[Callable[[str], Any]] = ...,
parse_constant: Optional[Callable[[str], Any]] = ...,
strict: bool = ...,
object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], Any]] = None) -> None: ...
object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], Any]] = ...) -> None: ...
def decode(self, s: str) -> Any: ...
def raw_decode(self, s: str, idx: int = ...) -> Tuple[Any, int]: ...

View File

@@ -13,7 +13,7 @@ class JSONEncoder:
def __init__(self, skipkeys: bool = ..., ensure_ascii: bool = ...,
check_circular: bool = ..., allow_nan: bool = ..., sort_keys: bool = ...,
indent: Optional[int] = ..., separators: Optional[Tuple[str, str]] = None, default: Optional[Callable] = ...) -> None: ...
indent: Optional[int] = ..., separators: Optional[Tuple[str, str]] = ..., default: Optional[Callable] = ...) -> None: ...
def default(self, o: Any) -> Any: ...
def encode(self, o: Any) -> str: ...

View File

@@ -29,8 +29,8 @@ class Pool(ContextManager[Pool]):
func: Callable[..., Any],
args: Iterable[Any] = ...,
kwds: Dict[str, Any] = ...,
callback: Optional[Callable[..., None]] = None,
error_callback: Optional[Callable[[BaseException], None]] = None) -> AsyncResult: ...
callback: Optional[Callable[..., None]] = ...,
error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult: ...
def map(self,
func: Callable[..., Any],
iterable: Iterable[Any] = ...,
@@ -38,8 +38,8 @@ class Pool(ContextManager[Pool]):
def map_async(self, func: Callable[..., Any],
iterable: Iterable[Any] = ...,
chunksize: Optional[int] = ...,
callback: Optional[Callable[..., None]] = None,
error_callback: Optional[Callable[[BaseException], None]] = None) -> AsyncResult: ...
callback: Optional[Callable[..., None]] = ...,
error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult: ...
def imap(self,
func: Callable[..., Any],
iterable: Iterable[Any] = ...,
@@ -56,8 +56,8 @@ class Pool(ContextManager[Pool]):
func: Callable[..., Any],
iterable: Iterable[Iterable[Any]] = ...,
chunksize: Optional[int] = ...,
callback: Optional[Callable[..., None]] = None,
error_callback: Optional[Callable[[BaseException], None]] = None) -> AsyncResult: ...
callback: Optional[Callable[..., None]] = ...,
error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult: ...
def close(self) -> None: ...
def terminate(self) -> None: ...
def join(self) -> None: ...
@@ -67,5 +67,5 @@ class Pool(ContextManager[Pool]):
class ThreadPool(Pool, ContextManager[ThreadPool]):
def __init__(self, processes: Optional[int] = ...,
initializer: Optional[Callable[..., Any]] = None,
initializer: Optional[Callable[..., Any]] = ...,
initargs: Iterable[Any] = ...) -> None: ...