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:
@@ -9,16 +9,16 @@ DEFAULT_BUFFER_SIZE = 0
|
||||
from typing import List, BinaryIO, TextIO, IO, overload, Iterator, Iterable, Any, Union
|
||||
|
||||
def open(file: Union[str, unicode, int],
|
||||
mode: unicode = 'r', buffering: int = -1, encoding: unicode = None,
|
||||
errors: unicode = None, newline: unicode = None,
|
||||
closefd: bool = True) -> IO[Any]: ...
|
||||
mode: unicode = ..., buffering: int = ..., encoding: unicode = ...,
|
||||
errors: unicode = ..., newline: unicode = ...,
|
||||
closefd: bool = ...) -> IO[Any]: ...
|
||||
|
||||
class IOBase:
|
||||
# TODO
|
||||
...
|
||||
|
||||
class BytesIO(BinaryIO):
|
||||
def __init__(self, initial_bytes: str = b'') -> None: ...
|
||||
def __init__(self, initial_bytes: str = ...) -> None: ...
|
||||
# TODO getbuffer
|
||||
# TODO see comments in BinaryIO for missing functionality
|
||||
def close(self) -> None: ...
|
||||
@@ -26,14 +26,14 @@ class BytesIO(BinaryIO):
|
||||
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) -> None: ...
|
||||
def readline(self, limit: int = ...) -> str: ...
|
||||
def readlines(self, hint: int = ...) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
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) -> None: ...
|
||||
def writelines(self, lines: Iterable[str]) -> None: ...
|
||||
@@ -45,22 +45,22 @@ class BytesIO(BinaryIO):
|
||||
def __exit__(self, type, value, traceback) -> bool: ...
|
||||
|
||||
class StringIO(TextIO):
|
||||
def __init__(self, initial_value: unicode = '',
|
||||
newline: unicode = None) -> None: ...
|
||||
def __init__(self, initial_value: unicode = ...,
|
||||
newline: unicode = ...) -> None: ...
|
||||
# TODO see comments in BinaryIO for missing functionality
|
||||
def close(self) -> None: ...
|
||||
def closed(self) -> bool: ...
|
||||
def fileno(self) -> int: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, n: int = -1) -> unicode: ...
|
||||
def read(self, n: int = ...) -> unicode: ...
|
||||
def readable(self) -> bool: ...
|
||||
def readline(self, limit: int = -1) -> unicode: ...
|
||||
def readlines(self, hint: int = -1) -> List[unicode]: ...
|
||||
def seek(self, offset: int, whence: int = 0) -> None: ...
|
||||
def readline(self, limit: int = ...) -> unicode: ...
|
||||
def readlines(self, hint: int = ...) -> List[unicode]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
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: unicode) -> None: ...
|
||||
def writelines(self, lines: Iterable[unicode]) -> None: ...
|
||||
@@ -72,24 +72,24 @@ class StringIO(TextIO):
|
||||
|
||||
class TextIOWrapper(TextIO):
|
||||
# write_through is undocumented but used by subprocess
|
||||
def __init__(self, buffer: IO[str], encoding: unicode = None,
|
||||
errors: unicode = None, newline: unicode = None,
|
||||
line_buffering: bool = False,
|
||||
write_through: bool = True) -> None: ...
|
||||
def __init__(self, buffer: IO[str], encoding: unicode = ...,
|
||||
errors: unicode = ..., newline: unicode = ...,
|
||||
line_buffering: bool = ...,
|
||||
write_through: bool = ...) -> None: ...
|
||||
# TODO see comments in BinaryIO for missing functionality
|
||||
def close(self) -> None: ...
|
||||
def closed(self) -> bool: ...
|
||||
def fileno(self) -> int: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, n: int = -1) -> unicode: ...
|
||||
def read(self, n: int = ...) -> unicode: ...
|
||||
def readable(self) -> bool: ...
|
||||
def readline(self, limit: int = -1) -> unicode: ...
|
||||
def readlines(self, hint: int = -1) -> List[unicode]: ...
|
||||
def seek(self, offset: int, whence: int = 0) -> None: ...
|
||||
def readline(self, limit: int = ...) -> unicode: ...
|
||||
def readlines(self, hint: int = ...) -> List[unicode]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
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: unicode) -> None: ...
|
||||
def writelines(self, lines: Iterable[unicode]) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user