mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 02:41:16 +08:00
Consistently use '= ...' for optional parameters.
This commit is contained in:
@@ -20,7 +20,7 @@ class UnsupportedOperation(ValueError, OSError): ...
|
||||
class IncrementalNewlineDecoder(codecs.IncrementalDecoder):
|
||||
newlines = ... # type: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def decode(self, input, final=False): ...
|
||||
def decode(self, input, final=...): ...
|
||||
def getstate(self): ...
|
||||
def reset(self): ...
|
||||
def setstate(self, state): ...
|
||||
@@ -42,7 +42,7 @@ class BufferedReader(_io._BufferedIOBase):
|
||||
name = ... # type: Any
|
||||
raw = ... # type: Any
|
||||
def __init__(self, raw, buffer_size=...) -> None: ...
|
||||
def peek(self, size: int = -1): ...
|
||||
def peek(self, size: int = ...): ...
|
||||
|
||||
class BufferedWriter(_io._BufferedIOBase):
|
||||
mode = ... # type: Any
|
||||
@@ -52,17 +52,17 @@ class BufferedWriter(_io._BufferedIOBase):
|
||||
|
||||
class BufferedRWPair(_io._BufferedIOBase):
|
||||
def __init__(self, reader, writer, buffer_size=...) -> None: ...
|
||||
def peek(self, size: int = -1): ...
|
||||
def peek(self, size: int = ...): ...
|
||||
|
||||
class BufferedRandom(_io._BufferedIOBase):
|
||||
mode = ... # type: Any
|
||||
name = ... # type: Any
|
||||
raw = ... # type: Any
|
||||
def __init__(self, raw, buffer_size=...) -> None: ...
|
||||
def peek(self, size: int = -1): ...
|
||||
def peek(self, size: int = ...): ...
|
||||
|
||||
class BytesIO(BinaryIO):
|
||||
def __init__(self, initial_bytes: bytes = b'') -> None: ...
|
||||
def __init__(self, initial_bytes: bytes = ...) -> None: ...
|
||||
# TODO getbuffer
|
||||
# TODO see comments in BinaryIO for missing functionality
|
||||
def close(self) -> None: ...
|
||||
@@ -71,14 +71,14 @@ class BytesIO(BinaryIO):
|
||||
def fileno(self) -> int: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, n: int = -1) -> bytes: ...
|
||||
def read(self, n: int = ...) -> bytes: ...
|
||||
def readable(self) -> bool: ...
|
||||
def readline(self, limit: int = -1) -> bytes: ...
|
||||
def readlines(self, hint: int = -1) -> List[bytes]: ...
|
||||
def seek(self, offset: int, whence: int = 0) -> int: ...
|
||||
def readline(self, limit: int = ...) -> bytes: ...
|
||||
def readlines(self, hint: int = ...) -> List[bytes]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: int = None) -> int: ...
|
||||
def truncate(self, size: int = ...) -> int: ...
|
||||
def writable(self) -> bool: ...
|
||||
@overload
|
||||
def write(self, s: bytes) -> int: ...
|
||||
@@ -93,8 +93,8 @@ class BytesIO(BinaryIO):
|
||||
def __exit__(self, type, value, traceback) -> bool: ...
|
||||
|
||||
class StringIO(TextIO):
|
||||
def __init__(self, initial_value: str = '',
|
||||
newline: str = None) -> None: ...
|
||||
def __init__(self, initial_value: str = ...,
|
||||
newline: str = ...) -> None: ...
|
||||
# TODO see comments in BinaryIO for missing functionality
|
||||
def close(self) -> None: ...
|
||||
@property
|
||||
@@ -102,14 +102,14 @@ class StringIO(TextIO):
|
||||
def fileno(self) -> int: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, n: int = -1) -> str: ...
|
||||
def read(self, n: int = ...) -> str: ...
|
||||
def readable(self) -> bool: ...
|
||||
def readline(self, limit: int = -1) -> str: ...
|
||||
def readlines(self, hint: int = -1) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = 0) -> int: ...
|
||||
def readline(self, limit: int = ...) -> str: ...
|
||||
def readlines(self, hint: int = ...) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: int = None) -> int: ...
|
||||
def truncate(self, size: int = ...) -> int: ...
|
||||
def writable(self) -> bool: ...
|
||||
def write(self, s: str) -> int: ...
|
||||
def writelines(self, lines: Iterable[str]) -> None: ...
|
||||
@@ -122,10 +122,10 @@ class StringIO(TextIO):
|
||||
class TextIOWrapper(TextIO):
|
||||
# TODO: This is actually a base class of _io._TextIOBase.
|
||||
# write_through is undocumented but used by subprocess
|
||||
def __init__(self, buffer: IO[bytes], encoding: str = None,
|
||||
errors: str = None, newline: str = None,
|
||||
line_buffering: bool = False,
|
||||
write_through: bool = True) -> None: ...
|
||||
def __init__(self, buffer: IO[bytes], encoding: str = ...,
|
||||
errors: str = ..., newline: str = ...,
|
||||
line_buffering: bool = ...,
|
||||
write_through: bool = ...) -> None: ...
|
||||
# TODO see comments in BinaryIO for missing functionality
|
||||
def close(self) -> None: ...
|
||||
@property
|
||||
@@ -133,14 +133,14 @@ class TextIOWrapper(TextIO):
|
||||
def fileno(self) -> int: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, n: int = -1) -> str: ...
|
||||
def read(self, n: int = ...) -> str: ...
|
||||
def readable(self) -> bool: ...
|
||||
def readline(self, limit: int = -1) -> str: ...
|
||||
def readlines(self, hint: int = -1) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = 0) -> int: ...
|
||||
def readline(self, limit: int = ...) -> str: ...
|
||||
def readlines(self, hint: int = ...) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: int = None) -> int: ...
|
||||
def truncate(self, size: int = ...) -> int: ...
|
||||
def writable(self) -> bool: ...
|
||||
def write(self, s: str) -> int: ...
|
||||
def writelines(self, lines: Iterable[str]) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user