mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-04-14 11:40:02 +08:00
@@ -2,6 +2,7 @@
|
||||
# Ron Murawski <ron@horizonchess.com>
|
||||
|
||||
from io import TextIOWrapper as _TextIOWrapper
|
||||
from posix import times_result
|
||||
import sys
|
||||
from typing import (
|
||||
Mapping, MutableMapping, Dict, List, Any, Tuple, IO, Iterable, Iterator, NoReturn, overload, Union, AnyStr,
|
||||
@@ -16,75 +17,72 @@ _T = TypeVar('_T')
|
||||
|
||||
# ----- os variables -----
|
||||
|
||||
if sys.version_info >= (3, 2):
|
||||
supports_bytes_environ: bool
|
||||
supports_bytes_environ: bool
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
supports_dir_fd: Set[Callable[..., Any]]
|
||||
supports_fd: Set[Callable[..., Any]]
|
||||
supports_effective_ids: Set[Callable[..., Any]]
|
||||
supports_follow_symlinks: Set[Callable[..., Any]]
|
||||
supports_dir_fd: Set[Callable[..., Any]]
|
||||
supports_fd: Set[Callable[..., Any]]
|
||||
supports_effective_ids: Set[Callable[..., Any]]
|
||||
supports_follow_symlinks: Set[Callable[..., Any]]
|
||||
|
||||
if sys.platform != 'win32':
|
||||
# Unix only
|
||||
PRIO_PROCESS: int
|
||||
PRIO_PGRP: int
|
||||
PRIO_USER: int
|
||||
if sys.platform != 'win32':
|
||||
# Unix only
|
||||
PRIO_PROCESS: int
|
||||
PRIO_PGRP: int
|
||||
PRIO_USER: int
|
||||
|
||||
F_LOCK: int
|
||||
F_TLOCK: int
|
||||
F_ULOCK: int
|
||||
F_TEST: int
|
||||
F_LOCK: int
|
||||
F_TLOCK: int
|
||||
F_ULOCK: int
|
||||
F_TEST: int
|
||||
|
||||
POSIX_FADV_NORMAL: int
|
||||
POSIX_FADV_SEQUENTIAL: int
|
||||
POSIX_FADV_RANDOM: int
|
||||
POSIX_FADV_NOREUSE: int
|
||||
POSIX_FADV_WILLNEED: int
|
||||
POSIX_FADV_DONTNEED: int
|
||||
POSIX_FADV_NORMAL: int
|
||||
POSIX_FADV_SEQUENTIAL: int
|
||||
POSIX_FADV_RANDOM: int
|
||||
POSIX_FADV_NOREUSE: int
|
||||
POSIX_FADV_WILLNEED: int
|
||||
POSIX_FADV_DONTNEED: int
|
||||
|
||||
SF_NODISKIO: int
|
||||
SF_MNOWAIT: int
|
||||
SF_SYNC: int
|
||||
SF_NODISKIO: int
|
||||
SF_MNOWAIT: int
|
||||
SF_SYNC: int
|
||||
|
||||
XATTR_SIZE_MAX: int # Linux only
|
||||
XATTR_CREATE: int # Linux only
|
||||
XATTR_REPLACE: int # Linux only
|
||||
XATTR_SIZE_MAX: int # Linux only
|
||||
XATTR_CREATE: int # Linux only
|
||||
XATTR_REPLACE: int # Linux only
|
||||
|
||||
P_PID: int
|
||||
P_PGID: int
|
||||
P_ALL: int
|
||||
P_PID: int
|
||||
P_PGID: int
|
||||
P_ALL: int
|
||||
|
||||
WEXITED: int
|
||||
WSTOPPED: int
|
||||
WNOWAIT: int
|
||||
WEXITED: int
|
||||
WSTOPPED: int
|
||||
WNOWAIT: int
|
||||
|
||||
CLD_EXITED: int
|
||||
CLD_DUMPED: int
|
||||
CLD_TRAPPED: int
|
||||
CLD_CONTINUED: int
|
||||
CLD_EXITED: int
|
||||
CLD_DUMPED: int
|
||||
CLD_TRAPPED: int
|
||||
CLD_CONTINUED: int
|
||||
|
||||
SCHED_OTHER: int # some flavors of Unix
|
||||
SCHED_BATCH: int # some flavors of Unix
|
||||
SCHED_IDLE: int # some flavors of Unix
|
||||
SCHED_SPORADIC: int # some flavors of Unix
|
||||
SCHED_FIFO: int # some flavors of Unix
|
||||
SCHED_RR: int # some flavors of Unix
|
||||
SCHED_RESET_ON_FORK: int # some flavors of Unix
|
||||
|
||||
RTLD_LAZY: int
|
||||
RTLD_NOW: int
|
||||
RTLD_GLOBAL: int
|
||||
RTLD_LOCAL: int
|
||||
RTLD_NODELETE: int
|
||||
RTLD_NOLOAD: int
|
||||
RTLD_DEEPBIND: int
|
||||
SCHED_OTHER: int # some flavors of Unix
|
||||
SCHED_BATCH: int # some flavors of Unix
|
||||
SCHED_IDLE: int # some flavors of Unix
|
||||
SCHED_SPORADIC: int # some flavors of Unix
|
||||
SCHED_FIFO: int # some flavors of Unix
|
||||
SCHED_RR: int # some flavors of Unix
|
||||
SCHED_RESET_ON_FORK: int # some flavors of Unix
|
||||
|
||||
RTLD_LAZY: int
|
||||
RTLD_NOW: int
|
||||
RTLD_GLOBAL: int
|
||||
RTLD_LOCAL: int
|
||||
RTLD_NODELETE: int
|
||||
RTLD_NOLOAD: int
|
||||
RTLD_DEEPBIND: int
|
||||
|
||||
SEEK_SET: int
|
||||
SEEK_CUR: int
|
||||
SEEK_END: int
|
||||
if sys.version_info >= (3, 3) and sys.platform != 'win32':
|
||||
if sys.platform != 'win32':
|
||||
SEEK_DATA: int # some flavors of Unix
|
||||
SEEK_HOLE: int # some flavors of Unix
|
||||
|
||||
@@ -104,8 +102,7 @@ O_SYNC: int # Unix only
|
||||
O_NDELAY: int # Unix only
|
||||
O_NONBLOCK: int # Unix only
|
||||
O_NOCTTY: int # Unix only
|
||||
if sys.version_info >= (3, 3):
|
||||
O_CLOEXEC: int # Unix only
|
||||
O_CLOEXEC: int # Unix only
|
||||
O_SHLOCK: int # Unix only
|
||||
O_EXLOCK: int # Unix only
|
||||
O_BINARY: int # Windows only
|
||||
@@ -120,9 +117,8 @@ O_DIRECT: int # Gnu extension if in C library
|
||||
O_DIRECTORY: int # Gnu extension if in C library
|
||||
O_NOFOLLOW: int # Gnu extension if in C library
|
||||
O_NOATIME: int # Gnu extension if in C library
|
||||
if sys.version_info >= (3, 4):
|
||||
O_PATH: int # Gnu extension if in C library
|
||||
O_TMPFILE: int # Gnu extension if in C library
|
||||
O_PATH: int # Gnu extension if in C library
|
||||
O_TMPFILE: int # Gnu extension if in C library
|
||||
O_LARGEFILE: int # Gnu extension if in C library
|
||||
|
||||
curdir: str
|
||||
@@ -153,8 +149,7 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]):
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
environ: _Environ[str]
|
||||
if sys.version_info >= (3, 2):
|
||||
environb: _Environ[bytes]
|
||||
environb: _Environ[bytes]
|
||||
|
||||
if sys.platform != 'win32':
|
||||
confstr_names: Dict[str, int]
|
||||
@@ -242,10 +237,7 @@ if sys.version_info >= (3, 6):
|
||||
from builtins import _PathLike as PathLike # See comment in builtins
|
||||
|
||||
_PathType = path._PathType
|
||||
if sys.version_info >= (3, 3):
|
||||
_FdOrPathType = Union[int, _PathType]
|
||||
else:
|
||||
_FdOrPathType = _PathType
|
||||
_FdOrPathType = Union[int, _PathType]
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
class DirEntry(PathLike[AnyStr]):
|
||||
@@ -261,7 +253,7 @@ if sys.version_info >= (3, 6):
|
||||
def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ...
|
||||
|
||||
def __fspath__(self) -> AnyStr: ...
|
||||
elif sys.version_info >= (3, 5):
|
||||
else:
|
||||
class DirEntry(Generic[AnyStr]):
|
||||
# This is what the scandir interator yields
|
||||
# The constructor is hidden
|
||||
@@ -321,15 +313,13 @@ if sys.platform != 'win32':
|
||||
def getegid() -> int: ...
|
||||
def geteuid() -> int: ...
|
||||
def getgid() -> int: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def getgrouplist(user: str, gid: int) -> List[int]: ...
|
||||
def getgrouplist(user: str, gid: int) -> List[int]: ...
|
||||
def getgroups() -> List[int]: ... # Unix only, behaves differently on Mac
|
||||
def initgroups(username: str, gid: int) -> None: ...
|
||||
def getpgid(pid: int) -> int: ...
|
||||
def getpgrp() -> int: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def getpriority(which: int, who: int) -> int: ...
|
||||
def setpriority(which: int, who: int, priority: int) -> None: ...
|
||||
def getpriority(which: int, who: int) -> int: ...
|
||||
def setpriority(which: int, who: int, priority: int) -> None: ...
|
||||
def getresuid() -> Tuple[int, int, int]: ...
|
||||
def getresgid() -> Tuple[int, int, int]: ...
|
||||
def getuid() -> int: ...
|
||||
@@ -346,11 +336,8 @@ if sys.platform != 'win32':
|
||||
def getsid(pid: int) -> int: ...
|
||||
def setsid() -> None: ...
|
||||
def setuid(uid: int) -> None: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
from posix import uname_result
|
||||
def uname() -> uname_result: ...
|
||||
else:
|
||||
def uname() -> Tuple[str, str, str, str, str]: ...
|
||||
from posix import uname_result
|
||||
def uname() -> uname_result: ...
|
||||
|
||||
@overload
|
||||
def getenv(key: Text) -> Optional[str]: ...
|
||||
@@ -369,17 +356,12 @@ def device_encoding(fd: int) -> Optional[str]: ...
|
||||
def dup(fd: int) -> int: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def dup2(fd: int, fd2: int, inheritable: bool = ...) -> int: ...
|
||||
elif sys.version_info >= (3, 4):
|
||||
def dup2(fd: int, fd2: int, inheritable: bool = ...) -> None: ...
|
||||
else:
|
||||
def dup2(fd: int, fd2: int) -> None: ...
|
||||
def dup2(fd: int, fd2: int, inheritable: bool = ...) -> None: ...
|
||||
def fstat(fd: int) -> stat_result: ...
|
||||
def fsync(fd: int) -> None: ...
|
||||
def lseek(fd: int, pos: int, how: int) -> int: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def open(file: _PathType, flags: int, mode: int = ..., *, dir_fd: Optional[int] = ...) -> int: ...
|
||||
else:
|
||||
def open(file: _PathType, flags: int, mode: int = ...) -> int: ...
|
||||
def open(file: _PathType, flags: int, mode: int = ..., *, dir_fd: Optional[int] = ...) -> int: ...
|
||||
def pipe() -> Tuple[int, int]: ...
|
||||
def read(fd: int, n: int) -> bytes: ...
|
||||
|
||||
@@ -391,33 +373,29 @@ if sys.platform != 'win32':
|
||||
def fpathconf(fd: int, name: Union[str, int]) -> int: ...
|
||||
def fstatvfs(fd: int) -> statvfs_result: ...
|
||||
def ftruncate(fd: int, length: int) -> None: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def get_blocking(fd: int) -> bool: ...
|
||||
def set_blocking(fd: int, blocking: bool) -> None: ...
|
||||
def get_blocking(fd: int) -> bool: ...
|
||||
def set_blocking(fd: int, blocking: bool) -> None: ...
|
||||
def isatty(fd: int) -> bool: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def lockf(__fd: int, __cmd: int, __length: int) -> None: ...
|
||||
def lockf(__fd: int, __cmd: int, __length: int) -> None: ...
|
||||
def openpty() -> Tuple[int, int]: ... # some flavors of Unix
|
||||
if sys.version_info >= (3, 3):
|
||||
def pipe2(flags: int) -> Tuple[int, int]: ... # some flavors of Unix
|
||||
def posix_fallocate(fd: int, offset: int, length: int) -> None: ...
|
||||
def posix_fadvise(fd: int, offset: int, length: int, advice: int) -> None: ...
|
||||
def pread(fd: int, buffersize: int, offset: int) -> bytes: ...
|
||||
def pwrite(fd: int, string: bytes, offset: int) -> int: ...
|
||||
@overload
|
||||
def sendfile(__out_fd: int, __in_fd: int, offset: Optional[int], count: int) -> int: ...
|
||||
@overload
|
||||
def sendfile(__out_fd: int, __in_fd: int, offset: int, count: int,
|
||||
headers: Sequence[bytes] = ..., trailers: Sequence[bytes] = ..., flags: int = ...) -> int: ... # FreeBSD and Mac OS X only
|
||||
def readv(fd: int, buffers: Sequence[bytearray]) -> int: ...
|
||||
def writev(fd: int, buffers: Sequence[bytes]) -> int: ...
|
||||
def pipe2(flags: int) -> Tuple[int, int]: ... # some flavors of Unix
|
||||
def posix_fallocate(fd: int, offset: int, length: int) -> None: ...
|
||||
def posix_fadvise(fd: int, offset: int, length: int, advice: int) -> None: ...
|
||||
def pread(fd: int, buffersize: int, offset: int) -> bytes: ...
|
||||
def pwrite(fd: int, string: bytes, offset: int) -> int: ...
|
||||
@overload
|
||||
def sendfile(__out_fd: int, __in_fd: int, offset: Optional[int], count: int) -> int: ...
|
||||
@overload
|
||||
def sendfile(__out_fd: int, __in_fd: int, offset: int, count: int,
|
||||
headers: Sequence[bytes] = ..., trailers: Sequence[bytes] = ..., flags: int = ...) -> int: ... # FreeBSD and Mac OS X only
|
||||
def readv(fd: int, buffers: Sequence[bytearray]) -> int: ...
|
||||
def writev(fd: int, buffers: Sequence[bytes]) -> int: ...
|
||||
|
||||
terminal_size = NamedTuple('terminal_size', [('columns', int), ('lines', int)])
|
||||
def get_terminal_size(fd: int = ...) -> terminal_size: ...
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
def get_inheritable(fd: int) -> bool: ...
|
||||
def set_inheritable(fd: int, inheritable: bool) -> None: ...
|
||||
def get_inheritable(fd: int) -> bool: ...
|
||||
def set_inheritable(fd: int, inheritable: bool) -> None: ...
|
||||
|
||||
if sys.platform != 'win32':
|
||||
# Unix only
|
||||
@@ -425,36 +403,36 @@ if sys.platform != 'win32':
|
||||
def tcsetpgrp(fd: int, pg: int) -> None: ...
|
||||
def ttyname(fd: int) -> str: ...
|
||||
def write(fd: int, string: bytes) -> int: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def access(path: _FdOrPathType, mode: int, *, dir_fd: Optional[int] = ...,
|
||||
effective_ids: bool = ..., follow_symlinks: bool = ...) -> bool: ...
|
||||
else:
|
||||
def access(path: _PathType, mode: int) -> bool: ...
|
||||
def access(
|
||||
path: _FdOrPathType,
|
||||
mode: int,
|
||||
*,
|
||||
dir_fd: Optional[int] = ...,
|
||||
effective_ids: bool = ...,
|
||||
follow_symlinks: bool = ...,
|
||||
) -> bool: ...
|
||||
def chdir(path: _FdOrPathType) -> None: ...
|
||||
def fchdir(fd: int) -> None: ...
|
||||
def getcwd() -> str: ...
|
||||
def getcwdb() -> bytes: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def chmod(path: _FdOrPathType, mode: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ...
|
||||
if sys.platform != 'win32':
|
||||
def chflags(path: _PathType, flags: int, follow_symlinks: bool = ...) -> None: ... # some flavors of Unix
|
||||
def chown(path: _FdOrPathType, uid: int, gid: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... # Unix only
|
||||
else:
|
||||
def chmod(path: _PathType, mode: int) -> None: ...
|
||||
if sys.platform != 'win32':
|
||||
def chflags(path: _PathType, flags: int) -> None: ... # Some flavors of Unix
|
||||
def chown(path: _PathType, uid: int, gid: int) -> None: ... # Unix only
|
||||
def chmod(path: _FdOrPathType, mode: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ...
|
||||
if sys.platform != 'win32':
|
||||
def chflags(path: _PathType, flags: int, follow_symlinks: bool = ...) -> None: ... # some flavors of Unix
|
||||
def chown(path: _FdOrPathType, uid: int, gid: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... # Unix only
|
||||
if sys.platform != 'win32':
|
||||
# Unix only
|
||||
def chroot(path: _PathType) -> None: ...
|
||||
def lchflags(path: _PathType, flags: int) -> None: ...
|
||||
def lchmod(path: _PathType, mode: int) -> None: ...
|
||||
def lchown(path: _PathType, uid: int, gid: int) -> None: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def link(src: _PathType, link_name: _PathType, *, src_dir_fd: Optional[int] = ...,
|
||||
dst_dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ...
|
||||
else:
|
||||
def link(src: _PathType, link_name: _PathType) -> None: ...
|
||||
def link(
|
||||
src: _PathType,
|
||||
link_name: _PathType,
|
||||
*,
|
||||
src_dir_fd: Optional[int] = ...,
|
||||
dst_dir_fd: Optional[int] = ...,
|
||||
follow_symlinks: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
@overload
|
||||
@@ -465,41 +443,20 @@ if sys.version_info >= (3, 6):
|
||||
def listdir(path: int) -> List[str]: ...
|
||||
@overload
|
||||
def listdir(path: PathLike[str]) -> List[str]: ...
|
||||
elif sys.version_info >= (3, 3):
|
||||
else:
|
||||
@overload
|
||||
def listdir(path: Optional[str] = ...) -> List[str]: ...
|
||||
@overload
|
||||
def listdir(path: bytes) -> List[bytes]: ...
|
||||
@overload
|
||||
def listdir(path: int) -> List[str]: ...
|
||||
else:
|
||||
@overload
|
||||
def listdir(path: Optional[str] = ...) -> List[str]: ...
|
||||
@overload
|
||||
def listdir(path: bytes) -> List[bytes]: ...
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
def lstat(path: _PathType, *, dir_fd: Optional[int] = ...) -> stat_result: ...
|
||||
def mkdir(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
if sys.platform != 'win32':
|
||||
def mkfifo(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... # Unix only
|
||||
else:
|
||||
def lstat(path: _PathType) -> stat_result: ...
|
||||
def mkdir(path: _PathType, mode: int = ...) -> None: ...
|
||||
if sys.platform != 'win32':
|
||||
def mkfifo(path: _PathType, mode: int = ...) -> None: ... # Unix only
|
||||
if sys.version_info >= (3, 4):
|
||||
def makedirs(name: _PathType, mode: int = ..., exist_ok: bool = ...) -> None: ...
|
||||
else:
|
||||
def makedirs(path: _PathType, mode: int = ..., exist_ok: bool = ...) -> None: ...
|
||||
if sys.version_info >= (3, 4):
|
||||
def mknod(path: _PathType, mode: int = ..., device: int = ...,
|
||||
*, dir_fd: Optional[int] = ...) -> None: ...
|
||||
elif sys.version_info >= (3, 3):
|
||||
def mknod(filename: _PathType, mode: int = ..., device: int = ...,
|
||||
*, dir_fd: Optional[int] = ...) -> None: ...
|
||||
else:
|
||||
def mknod(filename: _PathType, mode: int = ..., device: int = ...) -> None: ...
|
||||
def lstat(path: _PathType, *, dir_fd: Optional[int] = ...) -> stat_result: ...
|
||||
def mkdir(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
if sys.platform != 'win32':
|
||||
def mkfifo(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... # Unix only
|
||||
def makedirs(name: _PathType, mode: int = ..., exist_ok: bool = ...) -> None: ...
|
||||
def mknod(path: _PathType, mode: int = ..., device: int = ..., *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
def major(device: int) -> int: ...
|
||||
def minor(device: int) -> int: ...
|
||||
def makedev(major: int, minor: int) -> int: ...
|
||||
@@ -507,30 +464,14 @@ if sys.platform != 'win32':
|
||||
def pathconf(path: _FdOrPathType, name: Union[str, int]) -> int: ... # Unix only
|
||||
if sys.version_info >= (3, 6):
|
||||
def readlink(path: Union[AnyStr, PathLike[AnyStr]], *, dir_fd: Optional[int] = ...) -> AnyStr: ...
|
||||
elif sys.version_info >= (3, 3):
|
||||
else:
|
||||
def readlink(path: AnyStr, *, dir_fd: Optional[int] = ...) -> AnyStr: ...
|
||||
else:
|
||||
def readlink(path: AnyStr) -> AnyStr: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def remove(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
else:
|
||||
def remove(path: _PathType) -> None: ...
|
||||
if sys.version_info >= (3, 4):
|
||||
def removedirs(name: _PathType) -> None: ...
|
||||
else:
|
||||
def removedirs(path: _PathType) -> None: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def rename(src: _PathType, dst: _PathType, *,
|
||||
src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ...
|
||||
else:
|
||||
def rename(src: _PathType, dst: _PathType) -> None: ...
|
||||
def remove(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
def removedirs(name: _PathType) -> None: ...
|
||||
def rename(src: _PathType, dst: _PathType, *, src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ...
|
||||
def renames(old: _PathType, new: _PathType) -> None: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def replace(src: _PathType, dst: _PathType, *,
|
||||
src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ...
|
||||
def rmdir(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
else:
|
||||
def rmdir(path: _PathType) -> None: ...
|
||||
def replace(src: _PathType, dst: _PathType, *, src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ...
|
||||
def rmdir(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]):
|
||||
def __next__(self) -> DirEntry[AnyStr]: ...
|
||||
@@ -549,16 +490,12 @@ elif sys.version_info >= (3, 6):
|
||||
def scandir() -> _ScandirIterator[str]: ...
|
||||
@overload
|
||||
def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ...
|
||||
elif sys.version_info >= (3, 5):
|
||||
else:
|
||||
@overload
|
||||
def scandir() -> Iterator[DirEntry[str]]: ...
|
||||
@overload
|
||||
def scandir(path: AnyStr) -> Iterator[DirEntry[AnyStr]]: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def stat(path: _FdOrPathType, *, dir_fd: Optional[int] = ...,
|
||||
follow_symlinks: bool = ...) -> stat_result: ...
|
||||
else:
|
||||
def stat(path: _PathType) -> stat_result: ...
|
||||
def stat(path: _FdOrPathType, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> stat_result: ...
|
||||
if sys.version_info < (3, 7):
|
||||
@overload
|
||||
def stat_float_times() -> bool: ...
|
||||
@@ -566,22 +503,25 @@ if sys.version_info < (3, 7):
|
||||
def stat_float_times(__newvalue: bool) -> None: ...
|
||||
if sys.platform != 'win32':
|
||||
def statvfs(path: _FdOrPathType) -> statvfs_result: ... # Unix only
|
||||
if sys.version_info >= (3, 3):
|
||||
def symlink(source: _PathType, link_name: _PathType,
|
||||
target_is_directory: bool = ..., *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
if sys.platform != 'win32':
|
||||
def sync() -> None: ... # Unix only
|
||||
def truncate(path: _FdOrPathType, length: int) -> None: ... # Unix only up to version 3.4
|
||||
def unlink(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
def utime(path: _FdOrPathType, times: Optional[Union[Tuple[int, int], Tuple[float, float]]] = ..., *,
|
||||
ns: Tuple[int, int] = ..., dir_fd: Optional[int] = ...,
|
||||
follow_symlinks: bool = ...) -> None: ...
|
||||
else:
|
||||
def symlink(source: _PathType, link_name: _PathType,
|
||||
target_is_directory: bool = ...) -> None:
|
||||
... # final argument in Windows only
|
||||
def unlink(path: _PathType) -> None: ...
|
||||
def utime(path: _PathType, times: Optional[Tuple[float, float]]) -> None: ...
|
||||
def symlink(
|
||||
source: _PathType,
|
||||
link_name: _PathType,
|
||||
target_is_directory: bool = ...,
|
||||
*,
|
||||
dir_fd: Optional[int] = ...,
|
||||
) -> None: ...
|
||||
if sys.platform != 'win32':
|
||||
def sync() -> None: ... # Unix only
|
||||
def truncate(path: _FdOrPathType, length: int) -> None: ... # Unix only up to version 3.4
|
||||
def unlink(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
def utime(
|
||||
path: _FdOrPathType,
|
||||
times: Optional[Union[Tuple[int, int], Tuple[float, float]]] = ...,
|
||||
*,
|
||||
ns: Tuple[int, int] = ...,
|
||||
dir_fd: Optional[int] = ...,
|
||||
follow_symlinks: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
def walk(top: Union[AnyStr, PathLike[AnyStr]], topdown: bool = ...,
|
||||
@@ -592,7 +532,7 @@ else:
|
||||
def walk(top: AnyStr, topdown: bool = ..., onerror: Optional[Callable[[OSError], Any]] = ...,
|
||||
followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr],
|
||||
List[AnyStr]]]: ...
|
||||
if sys.platform != 'win32' and sys.version_info >= (3, 3):
|
||||
if sys.platform != 'win32':
|
||||
if sys.version_info >= (3, 7):
|
||||
@overload
|
||||
def fwalk(top: Union[str, PathLike[str]] = ..., topdown: bool = ...,
|
||||
@@ -643,17 +583,9 @@ if sys.platform != 'win32':
|
||||
def nice(increment: int) -> int: ...
|
||||
def plock(op: int) -> None: ... # ???op is int?
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
class _wrap_close(_TextIOWrapper):
|
||||
def close(self) -> Optional[int]: ... # type: ignore
|
||||
def popen(command: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ...
|
||||
else:
|
||||
class _wrap_close(IO[Text]):
|
||||
def close(self) -> Optional[int]: ...
|
||||
def popen(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> _wrap_close: ...
|
||||
def popen2(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> Tuple[IO[Text], IO[Text]]: ...
|
||||
def popen3(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> Tuple[IO[Text], IO[Text], IO[Text]]: ...
|
||||
def popen4(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> Tuple[IO[Text], IO[Text]]: ...
|
||||
class _wrap_close(_TextIOWrapper):
|
||||
def close(self) -> Optional[int]: ... # type: ignore
|
||||
def popen(command: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ...
|
||||
|
||||
def spawnl(mode: int, path: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ...
|
||||
def spawnle(mode: int, path: _PathType, arg0: Union[bytes, Text],
|
||||
@@ -662,11 +594,7 @@ def spawnv(mode: int, path: _PathType, args: List[Union[bytes, Text]]) -> int: .
|
||||
def spawnve(mode: int, path: _PathType, args: List[Union[bytes, Text]],
|
||||
env: Mapping[str, str]) -> int: ...
|
||||
def system(command: _PathType) -> int: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
from posix import times_result
|
||||
def times() -> times_result: ...
|
||||
else:
|
||||
def times() -> Tuple[float, float, float, float, float]: ...
|
||||
def times() -> times_result: ...
|
||||
def waitpid(pid: int, options: int) -> Tuple[int, int]: ...
|
||||
|
||||
if sys.platform == 'win32':
|
||||
@@ -678,9 +606,8 @@ else:
|
||||
def spawnvp(mode: int, file: _PathType, args: List[Union[bytes, Text]]) -> int: ...
|
||||
def spawnvpe(mode: int, file: _PathType, args: List[Union[bytes, Text]], env: Mapping[str, str]) -> int: ...
|
||||
def wait() -> Tuple[int, int]: ... # Unix only
|
||||
if sys.version_info >= (3, 3):
|
||||
from posix import waitid_result
|
||||
def waitid(idtype: int, ident: int, options: int) -> waitid_result: ...
|
||||
from posix import waitid_result
|
||||
def waitid(idtype: int, ident: int, options: int) -> waitid_result: ...
|
||||
def wait3(options: int) -> Tuple[int, int, Any]: ...
|
||||
def wait4(pid: int, options: int) -> Tuple[int, int, Any]: ...
|
||||
def WCOREDUMP(status: int) -> bool: ...
|
||||
@@ -692,7 +619,7 @@ else:
|
||||
def WSTOPSIG(status: int) -> int: ...
|
||||
def WTERMSIG(status: int) -> int: ...
|
||||
|
||||
if sys.platform != 'win32' and sys.version_info >= (3, 3):
|
||||
if sys.platform != 'win32':
|
||||
from posix import sched_param
|
||||
def sched_get_priority_min(policy: int) -> int: ... # some flavors of Unix
|
||||
def sched_get_priority_max(policy: int) -> int: ... # some flavors of Unix
|
||||
@@ -705,8 +632,7 @@ if sys.platform != 'win32' and sys.version_info >= (3, 3):
|
||||
def sched_setaffinity(pid: int, mask: Iterable[int]) -> None: ... # some flavors of Unix
|
||||
def sched_getaffinity(pid: int) -> Set[int]: ... # some flavors of Unix
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
def cpu_count() -> Optional[int]: ...
|
||||
def cpu_count() -> Optional[int]: ...
|
||||
if sys.platform != 'win32':
|
||||
# Unix only
|
||||
def confstr(name: Union[str, int]) -> Optional[str]: ...
|
||||
|
||||
Reference in New Issue
Block a user