Change numerous default values to ... (#1722)

This is the convention, and some default values (e.g. strings) apparently
break pytype.
This commit is contained in:
Jelle Zijlstra
2017-11-09 06:28:41 -08:00
committed by Matthias Kramm
parent 66821993f6
commit 54dd6ba27c
53 changed files with 521 additions and 521 deletions

View File

@@ -12,7 +12,7 @@ class simple_producer:
class async_chat(asyncore.dispatcher):
ac_in_buffer_size = ... # type: int
ac_out_buffer_size = ... # type: int
def __init__(self, sock: Optional[socket.socket] = None, map: Optional[asyncore._maptype] = None) -> None: ...
def __init__(self, sock: Optional[socket.socket] = ..., map: Optional[asyncore._maptype] = ...) -> None: ...
@abstractmethod
def collect_incoming_data(self, data: bytes) -> None: ...

View File

@@ -25,7 +25,7 @@ def poll2(timeout: float = ..., map: _maptype = ...) -> None: ...
poll3 = poll2
def loop(timeout: float = ..., use_poll: bool = ..., map: _maptype = ..., count: Optional[int] = None) -> None: ...
def loop(timeout: float = ..., use_poll: bool = ..., map: _maptype = ..., count: Optional[int] = ...) -> None: ...
# Not really subclass of socket.socket; it's only delegation.
@@ -39,7 +39,7 @@ class dispatcher:
closing = ... # type: bool
ignore_log_types = ... # type: frozenset[str]
def __init__(self, sock: Optional[socket.socket] = None, map: _maptype = ...) -> None: ...
def __init__(self, sock: Optional[socket.socket] = ..., map: _maptype = ...) -> None: ...
def add_channel(self, map: _maptype = ...) -> None: ...
def del_channel(self, map: _maptype = ...) -> None: ...
def create_socket(self, family: int, type: int) -> None: ...

View File

@@ -6,20 +6,20 @@ def compress(data: bytes, compresslevel: int = ...) -> bytes: ...
def decompress(data: bytes) -> bytes: ...
def open(filename: Union[str, bytes, IO[Any]],
mode: str = 'rb',
encoding: Optional[str] = None,
errors: Optional[str] = None,
newline: Optional[str] = None) -> IO[Any]: ...
mode: str = ...,
encoding: Optional[str] = ...,
errors: Optional[str] = ...,
newline: Optional[str] = ...) -> IO[Any]: ...
class BZ2File(BinaryIO):
def __init__(self,
filename: Union[str, bytes, IO[Any]],
mode: str = "r",
buffering: Optional[Any] = None,
compresslevel: int = 9) -> None: ...
buffering: Optional[Any] = ...,
compresslevel: int = ...) -> None: ...
class BZ2Compressor(object):
def __init__(self, compresslevel: int = 9) -> None: ...
def __init__(self, compresslevel: int = ...) -> None: ...
def compress(self, data: bytes) -> bytes: ...
def flush(self) -> bytes: ...

View File

@@ -70,12 +70,12 @@ if sys.version_info < (3, 0):
class TimeEncoding:
def __init__(self, locale: _LocaleType) -> None: ...
def __enter__(self) -> _LocaleType: ...
def __exit__(self, *args) -> None: ...
def __exit__(self, *args: Any) -> None: ...
else:
class different_locale:
def __init__(self, locale: _LocaleType) -> None: ...
def __enter__(self) -> _LocaleType: ...
def __exit__(self, *args) -> None: ...
def __exit__(self, *args: Any) -> None: ...
class LocaleTextCalendar(TextCalendar):
def __init__(self, firstweekday: int = ..., locale: Optional[_LocaleType] = ...) -> None: ...

View File

@@ -28,19 +28,19 @@ class Fraction(Rational):
numerator: Union[int, Rational] = 0,
denominator: Optional[Union[int, Rational]] = 0,
*,
_normalize: bool = True) -> None: ...
_normalize: bool = ...) -> None: ...
@overload
def __init__(self, value: float, *, _normalize: bool = True) -> None: ...
def __init__(self, value: float, *, _normalize: bool = ...) -> None: ...
@overload
def __init__(self, value: Decimal, *, _normalize: bool = True) -> None: ...
def __init__(self, value: Decimal, *, _normalize: bool = ...) -> None: ...
@overload
def __init__(self, value: str, *, _normalize: bool = True) -> None: ...
def __init__(self, value: str, *, _normalize: bool = ...) -> None: ...
@classmethod
def from_float(cls, f: float) -> 'Fraction': ...
@classmethod
def from_decimal(cls, dec: Decimal) -> 'Fraction': ...
def limit_denominator(self, max_denominator: int = 1000000) -> 'Fraction': ...
def limit_denominator(self, max_denominator: int = ...) -> 'Fraction': ...
@property
def numerator(self) -> int: ...

View File

@@ -76,7 +76,7 @@ class IMAP4:
def setquota(self, root: str, limits: str) -> CommandResults: ...
def sort(self, sort_criteria: str, charset: str, *search_criteria: List[str]) -> CommandResults: ...
if sys.version_info >= (3,):
def starttls(self, ssl_context: Optional[Any] = None) -> CommandResults: ...
def starttls(self, ssl_context: Optional[Any] = ...) -> CommandResults: ...
def status(self, mailbox: str, names: str) -> CommandResults: ...
def store(self, message_set: str, command: str, flags: List[str]) -> CommandResults: ...
def subscribe(self, mailbox: str) -> CommandResults: ...

View File

@@ -70,7 +70,7 @@ class Real(Complex, SupportsFloat):
@abstractmethod
def __ceil__(self) -> int: ...
@abstractmethod
def __round__(self, ndigits: Optional[int] = None): ...
def __round__(self, ndigits: Optional[int] = ...): ...
def __divmod__(self, other): ...
def __rdivmod__(self, other): ...
@abstractmethod

View File

@@ -23,7 +23,7 @@ def runcall(*args: Any, **kwds: Any) -> Any:
def set_trace() -> None:
...
def post_mortem(t: Optional[Any] = None) -> None:
def post_mortem(t: Optional[Any] = ...) -> None:
...
def pm() -> None:

View File

@@ -17,4 +17,4 @@ if sys.version_info >= (3, 2):
else:
def compile(file: _EitherStr, cfile: Optional[_EitherStr] = ..., dfile: Optional[_EitherStr] = ..., doraise: bool = ...) -> None: ...
def main(args: Optional[List[Text]] = ...): ...
def main(args: Optional[List[Text]] = ...) -> int: ...