Add default values for third-party stubs beginning with 'P' (#9957)

This commit is contained in:
Alex Waygood
2023-03-27 18:58:53 +01:00
committed by GitHub
parent 20f9b3685d
commit 6fd7e36e80
248 changed files with 2181 additions and 2133 deletions
+24 -24
View File
@@ -156,7 +156,7 @@ _Status: TypeAlias = Literal[
]
class Process:
def __init__(self, pid: int | None = ...) -> None: ...
def __init__(self, pid: int | None = None) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
@@ -164,7 +164,7 @@ class Process:
def pid(self) -> int: ...
def oneshot(self) -> AbstractContextManager[None]: ...
def as_dict(
self, attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Incomplete | None = ...
self, attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = None, ad_value: Incomplete | None = None
) -> dict[str, Any]: ...
def parent(self) -> Process: ...
def parents(self) -> list[Process]: ...
@@ -177,7 +177,7 @@ class Process:
def username(self) -> str: ...
def create_time(self) -> float: ...
def cwd(self) -> str: ...
def nice(self, value: int | None = ...) -> int: ...
def nice(self, value: int | None = None) -> int: ...
if sys.platform != "win32":
def uids(self) -> puids: ...
def gids(self) -> pgids: ...
@@ -185,9 +185,9 @@ class Process:
def num_fds(self) -> int: ...
if sys.platform != "darwin":
def io_counters(self): ...
def ionice(self, ioclass: int | None = ..., value: int | None = ...) -> pionice: ...
def cpu_affinity(self, cpus: list[int] | None = ...) -> list[int] | None: ...
def memory_maps(self, grouped: bool = ...): ...
def ionice(self, ioclass: int | None = None, value: int | None = None) -> pionice: ...
def cpu_affinity(self, cpus: list[int] | None = None) -> list[int] | None: ...
def memory_maps(self, grouped: bool = True): ...
if sys.platform == "linux":
def rlimit(self, resource: int, limits: tuple[int, int] | None = ...) -> tuple[int, int]: ...
def cpu_num(self) -> int: ...
@@ -199,21 +199,21 @@ class Process:
def num_ctx_switches(self) -> pctxsw: ...
def num_threads(self) -> int: ...
def threads(self) -> list[pthread]: ...
def children(self, recursive: bool = ...) -> list[Process]: ...
def cpu_percent(self, interval: float | None = ...) -> float: ...
def children(self, recursive: bool = False) -> list[Process]: ...
def cpu_percent(self, interval: float | None = None) -> float: ...
def cpu_times(self) -> pcputimes: ...
def memory_info(self) -> pmem: ...
def memory_info_ex(self) -> pmem: ...
def memory_full_info(self) -> pfullmem: ...
def memory_percent(self, memtype: str = ...) -> float: ...
def memory_percent(self, memtype: str = "rss") -> float: ...
def open_files(self) -> list[popenfile]: ...
def connections(self, kind: str = ...) -> list[pconn]: ...
def connections(self, kind: str = "inet") -> list[pconn]: ...
def send_signal(self, sig: int) -> None: ...
def suspend(self) -> None: ...
def resume(self) -> None: ...
def terminate(self) -> None: ...
def kill(self) -> None: ...
def wait(self, timeout: int | None = ...) -> int: ...
def wait(self, timeout: int | None = None) -> int: ...
class Popen(Process):
def __init__(self, *args, **kwargs) -> None: ...
@@ -224,31 +224,31 @@ class Popen(Process):
def pids() -> list[int]: ...
def pid_exists(pid: int) -> bool: ...
def process_iter(
attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Incomplete | None = ...
attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = None, ad_value: Incomplete | None = None
) -> Iterator[Process]: ...
def wait_procs(
procs: Iterable[Process], timeout: float | None = ..., callback: Callable[[Process], object] | None = ...
procs: Iterable[Process], timeout: float | None = None, callback: Callable[[Process], object] | None = None
) -> tuple[list[Process], list[Process]]: ...
def cpu_count(logical: bool = ...) -> int: ...
def cpu_times(percpu: bool = ...): ...
def cpu_percent(interval: float | None = ..., percpu: bool = ...) -> float: ...
def cpu_times_percent(interval: float | None = ..., percpu: bool = ...): ...
def cpu_count(logical: bool = True) -> int: ...
def cpu_times(percpu: bool = False): ...
def cpu_percent(interval: float | None = None, percpu: bool = False) -> float: ...
def cpu_times_percent(interval: float | None = None, percpu: bool = False): ...
def cpu_stats() -> scpustats: ...
def cpu_freq(percpu: bool = ...) -> scpufreq: ...
def cpu_freq(percpu: bool = False) -> scpufreq: ...
def getloadavg() -> tuple[float, float, float]: ...
def virtual_memory() -> svmem: ...
def swap_memory() -> sswap: ...
def disk_usage(path: str) -> sdiskusage: ...
def disk_partitions(all: bool = ...) -> list[sdiskpart]: ...
def disk_partitions(all: bool = False) -> list[sdiskpart]: ...
@overload
def disk_io_counters(perdisk: Literal[False] = ..., nowrap: bool = ...) -> sdiskio | None: ...
def disk_io_counters(perdisk: Literal[False] = False, nowrap: bool = True) -> sdiskio | None: ...
@overload
def disk_io_counters(perdisk: Literal[True], nowrap: bool = ...) -> dict[str, sdiskio]: ...
def disk_io_counters(perdisk: Literal[True], nowrap: bool = True) -> dict[str, sdiskio]: ...
@overload
def net_io_counters(pernic: Literal[False] = ..., nowrap: bool = ...) -> snetio: ...
def net_io_counters(pernic: Literal[False] = False, nowrap: bool = True) -> snetio: ...
@overload
def net_io_counters(pernic: Literal[True], nowrap: bool = ...) -> dict[str, snetio]: ...
def net_connections(kind: str = ...) -> list[sconn]: ...
def net_io_counters(pernic: Literal[True], nowrap: bool = True) -> dict[str, snetio]: ...
def net_connections(kind: str = "inet") -> list[sconn]: ...
def net_if_addrs() -> dict[str, list[snicaddr]]: ...
def net_if_stats() -> dict[str, snicstats]: ...
def boot_time() -> float: ...
+10 -10
View File
@@ -222,7 +222,7 @@ class NoSuchProcess(Error):
pid: Any
name: Any
msg: Any
def __init__(self, pid, name: Incomplete | None = ..., msg: Incomplete | None = ...) -> None: ...
def __init__(self, pid, name: Incomplete | None = None, msg: Incomplete | None = None) -> None: ...
class ZombieProcess(NoSuchProcess):
__module__: str
@@ -231,7 +231,7 @@ class ZombieProcess(NoSuchProcess):
name: Any
msg: Any
def __init__(
self, pid, name: Incomplete | None = ..., ppid: Incomplete | None = ..., msg: Incomplete | None = ...
self, pid, name: Incomplete | None = None, ppid: Incomplete | None = None, msg: Incomplete | None = None
) -> None: ...
class AccessDenied(Error):
@@ -239,18 +239,18 @@ class AccessDenied(Error):
pid: Any
name: Any
msg: Any
def __init__(self, pid: Incomplete | None = ..., name: Incomplete | None = ..., msg: Incomplete | None = ...) -> None: ...
def __init__(self, pid: Incomplete | None = None, name: Incomplete | None = None, msg: Incomplete | None = None) -> None: ...
class TimeoutExpired(Error):
__module__: str
seconds: Any
pid: Any
name: Any
def __init__(self, seconds, pid: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ...
def __init__(self, seconds, pid: Incomplete | None = None, name: Incomplete | None = None) -> None: ...
_Func = TypeVar("_Func", bound=Callable[..., Any])
def usage_percent(used, total, round_: int | None = ...) -> float: ...
def usage_percent(used, total, round_: int | None = None) -> float: ...
def memoize(fun: _Func) -> _Func: ...
def memoize_when_activated(fun: _Func) -> _Func: ...
def isfile_strict(path: StrOrBytesPath) -> bool: ...
@@ -262,7 +262,7 @@ def socktype_to_enum(num: int) -> SocketKind: ...
@overload
def conn_to_ntuple(fd: int, fam: int, type_: int, laddr, raddr, status: str, status_map, pid: int) -> sconn: ...
@overload
def conn_to_ntuple(fd: int, fam: int, type_: int, laddr, raddr, status: str, status_map, pid: None = ...) -> pconn: ...
def conn_to_ntuple(fd: int, fam: int, type_: int, laddr, raddr, status: str, status_map, pid: None = None) -> pconn: ...
def deprecated_method(replacement: str) -> Callable[[_Func], _Func]: ...
class _WrapNumbers:
@@ -272,7 +272,7 @@ class _WrapNumbers:
reminder_keys: Any
def __init__(self) -> None: ...
def run(self, input_dict, name): ...
def cache_clear(self, name: Incomplete | None = ...) -> None: ...
def cache_clear(self, name: Incomplete | None = None) -> None: ...
def cache_info(self): ...
def wrap_numbers(input_dict, name: str): ...
@@ -280,9 +280,9 @@ def open_binary(fname): ...
def open_text(fname): ...
def cat(fname, fallback=..., _open=...): ...
def bcat(fname, fallback=...): ...
def bytes2human(n: int, format: str = ...) -> str: ...
def bytes2human(n: int, format: str = "%(value).1f%(symbol)s") -> str: ...
def get_procfs_path() -> str: ...
def term_supports_colors(file: SupportsWrite[str] = ...) -> bool: ...
def hilite(s: str, color: str | None = ..., bold: bool = ...) -> str: ...
def print_color(s: str, color: str | None = ..., bold: bool = ..., file: SupportsWrite[str] = ...) -> None: ...
def hilite(s: str, color: str | None = None, bold: bool = False) -> str: ...
def print_color(s: str, color: str | None = None, bold: bool = False, file: SupportsWrite[str] = ...) -> None: ...
def debug(msg) -> None: ...
+2 -2
View File
@@ -3,8 +3,8 @@ from _typeshed import Incomplete
def pid_exists(pid): ...
def wait_pid(
pid,
timeout: Incomplete | None = ...,
proc_name: Incomplete | None = ...,
timeout: Incomplete | None = None,
proc_name: Incomplete | None = None,
_waitpid=...,
_timer=...,
_min=...,
+4 -4
View File
@@ -130,7 +130,7 @@ def cpu_count_cores() -> int | None: ...
def cpu_stats(): ...
def cpu_freq(): ...
def getloadavg(): ...
def net_connections(kind, _pid: int = ...): ...
def net_connections(kind, _pid: int = -1): ...
def net_if_stats(): ...
def net_io_counters(): ...
def net_if_addrs(): ...
@@ -159,7 +159,7 @@ pid_exists: Any
ppid_map: Any
def is_permission_err(exc): ...
def convert_oserror(exc, pid: Incomplete | None = ..., name: Incomplete | None = ...): ...
def convert_oserror(exc, pid: Incomplete | None = None, name: Incomplete | None = None): ...
def wrap_exceptions(fun): ...
def retry_error_partial_copy(fun): ...
@@ -178,7 +178,7 @@ class Process:
def memory_maps(self) -> None: ...
def kill(self): ...
def send_signal(self, sig) -> None: ...
def wait(self, timeout: Incomplete | None = ...): ...
def wait(self, timeout: Incomplete | None = None): ...
def username(self): ...
def create_time(self): ...
def num_threads(self): ...
@@ -188,7 +188,7 @@ class Process:
def resume(self) -> None: ...
def cwd(self): ...
def open_files(self): ...
def connections(self, kind: str = ...): ...
def connections(self, kind: str = "inet"): ...
def nice_get(self): ...
def nice_set(self, value): ...
def ionice_get(self): ...