mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-03 18:13:36 +08:00
Consistently use '= ...' for optional parameters.
This commit is contained in:
@@ -157,7 +157,7 @@ class statvfs_result: # Unix only
|
||||
def name() -> str: ...
|
||||
def fsencode(filename: str) -> bytes: ...
|
||||
def fsdecode(filename: bytes) -> str: ...
|
||||
def get_exec_path(env=None) -> List[str] : ...
|
||||
def get_exec_path(env=...) -> List[str] : ...
|
||||
# NOTE: get_exec_path(): returns List[bytes] when env not None
|
||||
def ctermid() -> str: ... # Unix only
|
||||
def getegid() -> int: ... # Unix only
|
||||
@@ -173,8 +173,8 @@ def getppid() -> int: ...
|
||||
def getresuid() -> Tuple[int, int, int]: ... # Unix only
|
||||
def getresgid() -> Tuple[int, int, int]: ... # Unix only
|
||||
def getuid() -> int: ... # Unix only
|
||||
def getenv(key: str, default: str = None) -> str: ...
|
||||
def getenvb(key: bytes, default: bytes = None) -> bytes: ...
|
||||
def getenv(key: str, default: str = ...) -> str: ...
|
||||
def getenvb(key: bytes, default: bytes = ...) -> bytes: ...
|
||||
# TODO mixed str/bytes putenv arguments
|
||||
def putenv(key: AnyStr, value: AnyStr) -> None: ...
|
||||
def setegid(egid: int) -> None: ... # Unix only
|
||||
@@ -195,8 +195,8 @@ def umask(mask: int) -> int: ...
|
||||
def uname() -> Tuple[str, str, str, str, str]: ... # Unix only
|
||||
def unsetenv(key: AnyStr) -> None: ...
|
||||
# Return IO or TextIO
|
||||
def fdopen(fd: int, mode: str = 'r', encoding: str = None, errors: str = None,
|
||||
newline: str = None, closefd: bool = True) -> Any: ...
|
||||
def fdopen(fd: int, mode: str = ..., encoding: str = ..., errors: str = ...,
|
||||
newline: str = ..., closefd: bool = ...) -> Any: ...
|
||||
def close(fd: int) -> None: ...
|
||||
def closerange(fd_low: int, fd_high: int) -> None: ...
|
||||
def device_encoding(fd: int) -> Optional[str]: ...
|
||||
@@ -212,7 +212,7 @@ def fsync(fd: int) -> None: ...
|
||||
def ftruncate(fd: int, length: int) -> None: ... # Unix only
|
||||
def isatty(fd: int) -> bool: ... # Unix only
|
||||
def lseek(fd: int, pos: int, how: int) -> int: ...
|
||||
def open(file: AnyStr, flags: int, mode: int = 0o777) -> int: ...
|
||||
def open(file: AnyStr, flags: int, mode: int = ...) -> int: ...
|
||||
def openpty() -> Tuple[int, int]: ... # some flavors of Unix
|
||||
def pipe() -> Tuple[int, int]: ...
|
||||
def read(fd: int, n: int) -> bytes: ...
|
||||
@@ -235,19 +235,19 @@ def lchown(path: str, uid: int, gid: int) -> None: ... # Unix only
|
||||
def link(src: AnyStr, link_name: AnyStr) -> None: ...
|
||||
|
||||
@overload
|
||||
def listdir(path: str = '.') -> List[str]: ...
|
||||
def listdir(path: str = ...) -> List[str]: ...
|
||||
@overload
|
||||
def listdir(path: bytes) -> List[bytes]: ...
|
||||
|
||||
def lstat(path: AnyStr) -> stat_result: ...
|
||||
def mkfifo(path, mode: int=0o666) -> None: ... # Unix only
|
||||
def mknod(filename: AnyStr, mode: int = 0o600, device: int = 0) -> None: ...
|
||||
def mkfifo(path, mode: int=...) -> None: ... # Unix only
|
||||
def mknod(filename: AnyStr, mode: int = ..., device: int = ...) -> None: ...
|
||||
def major(device: int) -> int: ...
|
||||
def minor(device: int) -> int: ...
|
||||
def makedev(major: int, minor: int) -> int: ...
|
||||
def mkdir(path: AnyStr, mode: int = 0o777) -> None: ...
|
||||
def makedirs(path: AnyStr, mode: int = 0o777,
|
||||
exist_ok: bool = False) -> None: ...
|
||||
def mkdir(path: AnyStr, mode: int = ...) -> None: ...
|
||||
def makedirs(path: AnyStr, mode: int = ...,
|
||||
exist_ok: bool = ...) -> None: ...
|
||||
def pathconf(path: str, name: str) -> int: ... # Unix only
|
||||
def readlink(path: AnyStr) -> AnyStr: ...
|
||||
def remove(path: AnyStr) -> None: ...
|
||||
@@ -256,17 +256,17 @@ def rename(src: AnyStr, dst: AnyStr) -> None: ...
|
||||
def renames(old: AnyStr, new: AnyStr) -> None: ...
|
||||
def rmdir(path: AnyStr) -> None: ...
|
||||
def stat(path: AnyStr) -> stat_result: ...
|
||||
def stat_float_times(newvalue: Union[bool, None] = None) -> bool: ...
|
||||
def stat_float_times(newvalue: Union[bool, None] = ...) -> bool: ...
|
||||
def statvfs(path: str) -> statvfs_result: ... # Unix only
|
||||
def symlink(source: AnyStr, link_name: AnyStr,
|
||||
target_is_directory: bool = False) -> None:
|
||||
target_is_directory: bool = ...) -> None:
|
||||
... # final argument in Windows only
|
||||
def unlink(path: AnyStr) -> None: ...
|
||||
def utime(path: AnyStr, times: Union[Tuple[int, int], Tuple[float, float]] = None) -> None: ...
|
||||
def utime(path: AnyStr, times: Union[Tuple[int, int], Tuple[float, float]] = ...) -> None: ...
|
||||
|
||||
# TODO onerror: function from OSError to void
|
||||
def walk(top: AnyStr, topdown: bool = True, onerror: Any = None,
|
||||
followlinks: bool = False) -> Iterator[Tuple[AnyStr, List[AnyStr],
|
||||
def walk(top: AnyStr, topdown: bool = ..., onerror: Any = ...,
|
||||
followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr],
|
||||
List[AnyStr]]]: ...
|
||||
# walk(): "By default errors from the os.listdir() call are ignored. If
|
||||
# optional arg 'onerror' is specified, it should be a function; it
|
||||
@@ -298,8 +298,8 @@ def plock(op: int) -> None: ... # Unix only ???op is int?
|
||||
from io import TextIOWrapper as _TextIOWrapper
|
||||
class popen(_TextIOWrapper):
|
||||
# TODO 'b' modes or bytes command not accepted?
|
||||
def __init__(self, command: str, mode: str = 'r',
|
||||
bufsize: int = -1) -> None: ...
|
||||
def __init__(self, command: str, mode: str = ...,
|
||||
bufsize: int = ...) -> None: ...
|
||||
def close(self) -> Any: ... # may return int
|
||||
|
||||
def spawnl(mode: int, path: AnyStr, arg0: AnyStr, *args: AnyStr) -> int: ...
|
||||
@@ -316,12 +316,12 @@ def spawnvp(mode: int, file: AnyStr, args: List[AnyStr]) -> int: ... # Unix onl
|
||||
def spawnvpe(mode: int, file: AnyStr, args: List[AnyStr],
|
||||
env: Mapping[str, str]) -> int:
|
||||
... # Unix only
|
||||
def startfile(path: str, operation: Union[str, None] = None) -> None: ... # Windows only
|
||||
def startfile(path: str, operation: Union[str, None] = ...) -> None: ... # Windows only
|
||||
def system(command: AnyStr) -> int: ...
|
||||
def times() -> Tuple[float, float, float, float, float]: ...
|
||||
def wait() -> Tuple[int, int]: ... # Unix only
|
||||
def waitpid(pid: int, options: int) -> Tuple[int, int]: ...
|
||||
def wait3(options: Union[int, None] = None) -> Tuple[int, int, Any]: ... # Unix only
|
||||
def wait3(options: Union[int, None] = ...) -> Tuple[int, int, Any]: ... # Unix only
|
||||
def wait4(pid: int, options: int) -> Tuple[int, int, Any]:
|
||||
... # Unix only
|
||||
def WCOREDUMP(status: int) -> bool: ... # Unix only
|
||||
|
||||
@@ -47,7 +47,7 @@ def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ...
|
||||
def normcase(path: AnyStr) -> AnyStr: ...
|
||||
def normpath(path: AnyStr) -> AnyStr: ...
|
||||
def realpath(path: AnyStr) -> AnyStr: ...
|
||||
def relpath(path: AnyStr, start: AnyStr = None) -> AnyStr: ...
|
||||
def relpath(path: AnyStr, start: AnyStr = ...) -> AnyStr: ...
|
||||
|
||||
def samefile(path1: AnyStr, path2: AnyStr) -> bool: ...
|
||||
def sameopenfile(fp1: int, fp2: int) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user