mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Replace Any with Incomplete in many places (#9558)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from _typeshed import Incomplete, Self
|
||||
from collections.abc import Callable, Iterable, Iterator
|
||||
from contextlib import AbstractContextManager
|
||||
from typing import Any, overload
|
||||
@@ -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: Any | None = ...
|
||||
self, attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Incomplete | None = ...
|
||||
) -> dict[str, Any]: ...
|
||||
def parent(self) -> Process: ...
|
||||
def parents(self) -> list[Process]: ...
|
||||
@@ -224,7 +224,7 @@ 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: Any | None = ...
|
||||
attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Incomplete | None = ...
|
||||
) -> Iterator[Process]: ...
|
||||
def wait_procs(
|
||||
procs: Iterable[Process], timeout: float | None = ..., callback: Callable[[Process], object] | None = ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import enum
|
||||
from _typeshed import StrOrBytesPath, SupportsWrite
|
||||
from _typeshed import Incomplete, StrOrBytesPath, SupportsWrite
|
||||
from collections.abc import Callable
|
||||
from socket import AF_INET6 as AF_INET6, AddressFamily, SocketKind
|
||||
from typing import Any, NamedTuple, TypeVar, overload
|
||||
@@ -222,7 +222,7 @@ class NoSuchProcess(Error):
|
||||
pid: Any
|
||||
name: Any
|
||||
msg: Any
|
||||
def __init__(self, pid, name: Any | None = ..., msg: Any | None = ...) -> None: ...
|
||||
def __init__(self, pid, name: Incomplete | None = ..., msg: Incomplete | None = ...) -> None: ...
|
||||
|
||||
class ZombieProcess(NoSuchProcess):
|
||||
__module__: str
|
||||
@@ -230,21 +230,23 @@ class ZombieProcess(NoSuchProcess):
|
||||
ppid: Any
|
||||
name: Any
|
||||
msg: Any
|
||||
def __init__(self, pid, name: Any | None = ..., ppid: Any | None = ..., msg: Any | None = ...) -> None: ...
|
||||
def __init__(
|
||||
self, pid, name: Incomplete | None = ..., ppid: Incomplete | None = ..., msg: Incomplete | None = ...
|
||||
) -> None: ...
|
||||
|
||||
class AccessDenied(Error):
|
||||
__module__: str
|
||||
pid: Any
|
||||
name: Any
|
||||
msg: Any
|
||||
def __init__(self, pid: Any | None = ..., name: Any | None = ..., msg: Any | None = ...) -> None: ...
|
||||
def __init__(self, pid: Incomplete | None = ..., name: Incomplete | None = ..., msg: Incomplete | None = ...) -> None: ...
|
||||
|
||||
class TimeoutExpired(Error):
|
||||
__module__: str
|
||||
seconds: Any
|
||||
pid: Any
|
||||
name: Any
|
||||
def __init__(self, seconds, pid: Any | None = ..., name: Any | None = ...) -> None: ...
|
||||
def __init__(self, seconds, pid: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ...
|
||||
|
||||
_Func = TypeVar("_Func", bound=Callable[..., Any])
|
||||
|
||||
@@ -270,7 +272,7 @@ class _WrapNumbers:
|
||||
reminder_keys: Any
|
||||
def __init__(self) -> None: ...
|
||||
def run(self, input_dict, name): ...
|
||||
def cache_clear(self, name: Any | None = ...) -> None: ...
|
||||
def cache_clear(self, name: Incomplete | None = ...) -> None: ...
|
||||
def cache_info(self): ...
|
||||
|
||||
def wrap_numbers(input_dict, name: str): ...
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Incomplete
|
||||
from contextlib import AbstractContextManager
|
||||
from typing import Any, NamedTuple
|
||||
|
||||
@@ -135,7 +136,7 @@ class Process:
|
||||
def num_ctx_switches(self): ...
|
||||
def threads(self): ...
|
||||
def connections(self, kind: str = ...): ...
|
||||
def wait(self, timeout: Any | None = ...): ...
|
||||
def wait(self, timeout: Incomplete | None = ...): ...
|
||||
def nice_get(self): ...
|
||||
def nice_set(self, value): ...
|
||||
def status(self): ...
|
||||
@@ -162,4 +163,4 @@ class Process:
|
||||
def cpu_affinity_get(self): ...
|
||||
def cpu_affinity_set(self, cpus) -> None: ...
|
||||
def memory_maps(self): ...
|
||||
def rlimit(self, resource, limits: Any | None = ...): ...
|
||||
def rlimit(self, resource, limits: Incomplete | None = ...): ...
|
||||
|
||||
@@ -146,10 +146,10 @@ class Connections:
|
||||
@staticmethod
|
||||
def decode_address(addr, family): ...
|
||||
@staticmethod
|
||||
def process_inet(file, family, type_, inodes, filter_pid: Any | None = ...) -> None: ...
|
||||
def process_inet(file, family, type_, inodes, filter_pid: Incomplete | None = ...) -> None: ...
|
||||
@staticmethod
|
||||
def process_unix(file, family, inodes, filter_pid: Any | None = ...) -> None: ...
|
||||
def retrieve(self, kind, pid: Any | None = ...): ...
|
||||
def process_unix(file, family, inodes, filter_pid: Incomplete | None = ...) -> None: ...
|
||||
def retrieve(self, kind, pid: Incomplete | None = ...): ...
|
||||
|
||||
def net_connections(kind: str = ...): ...
|
||||
def net_io_counters(): ...
|
||||
@@ -192,7 +192,7 @@ class Process:
|
||||
def io_counters(self): ...
|
||||
def cpu_times(self): ...
|
||||
def cpu_num(self): ...
|
||||
def wait(self, timeout: Any | None = ...): ...
|
||||
def wait(self, timeout: Incomplete | None = ...): ...
|
||||
def create_time(self): ...
|
||||
def memory_info(self): ...
|
||||
def memory_full_info(self): ...
|
||||
@@ -207,7 +207,7 @@ class Process:
|
||||
def cpu_affinity_set(self, cpus) -> None: ...
|
||||
def ionice_get(self): ...
|
||||
def ionice_set(self, ioclass, value): ...
|
||||
def rlimit(self, resource_, limits: Any | None = ...): ...
|
||||
def rlimit(self, resource_, limits: Incomplete | None = ...): ...
|
||||
def status(self): ...
|
||||
def open_files(self): ...
|
||||
def connections(self, kind: str = ...): ...
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import Any, NamedTuple
|
||||
|
||||
from psutil._common import (
|
||||
@@ -95,7 +96,7 @@ class Process:
|
||||
def open_files(self): ...
|
||||
def connections(self, kind: str = ...): ...
|
||||
def num_fds(self): ...
|
||||
def wait(self, timeout: Any | None = ...): ...
|
||||
def wait(self, timeout: Incomplete | None = ...): ...
|
||||
def nice_get(self): ...
|
||||
def nice_set(self, value): ...
|
||||
def status(self): ...
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
from typing import Any
|
||||
from _typeshed import Incomplete
|
||||
|
||||
def pid_exists(pid): ...
|
||||
def wait_pid(
|
||||
pid, timeout: Any | None = ..., proc_name: Any | None = ..., _waitpid=..., _timer=..., _min=..., _sleep=..., _pid_exists=...
|
||||
pid,
|
||||
timeout: Incomplete | None = ...,
|
||||
proc_name: Incomplete | None = ...,
|
||||
_waitpid=...,
|
||||
_timer=...,
|
||||
_min=...,
|
||||
_sleep=...,
|
||||
_pid_exists=...,
|
||||
): ...
|
||||
def disk_usage(path): ...
|
||||
def get_terminal_map(): ...
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import enum
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Iterable
|
||||
from typing import Any, NamedTuple
|
||||
|
||||
@@ -145,7 +146,7 @@ pid_exists: Any
|
||||
ppid_map: Any
|
||||
|
||||
def is_permission_err(exc): ...
|
||||
def convert_oserror(exc, pid: Any | None = ..., name: Any | None = ...): ...
|
||||
def convert_oserror(exc, pid: Incomplete | None = ..., name: Incomplete | None = ...): ...
|
||||
def wrap_exceptions(fun): ...
|
||||
def retry_error_partial_copy(fun): ...
|
||||
|
||||
@@ -164,7 +165,7 @@ class Process:
|
||||
def memory_maps(self) -> None: ...
|
||||
def kill(self): ...
|
||||
def send_signal(self, sig) -> None: ...
|
||||
def wait(self, timeout: Any | None = ...): ...
|
||||
def wait(self, timeout: Incomplete | None = ...): ...
|
||||
def username(self): ...
|
||||
def create_time(self): ...
|
||||
def num_threads(self): ...
|
||||
|
||||
Reference in New Issue
Block a user