mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
psutil: Improve types for disk_io_counters() and net_io_counters() (#8829)
This commit is contained in:
@@ -2,7 +2,7 @@ import sys
|
||||
from _typeshed import Self
|
||||
from collections.abc import Callable, Iterable, Iterator
|
||||
from contextlib import AbstractContextManager
|
||||
from typing import Any
|
||||
from typing import Any, overload
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
from ._common import (
|
||||
@@ -225,8 +225,14 @@ def virtual_memory() -> svmem: ...
|
||||
def swap_memory() -> sswap: ...
|
||||
def disk_usage(path: str) -> sdiskusage: ...
|
||||
def disk_partitions(all: bool = ...) -> list[sdiskpart]: ...
|
||||
def disk_io_counters(perdisk: bool = ..., nowrap: bool = ...) -> sdiskio: ...
|
||||
def net_io_counters(pernic: bool = ..., nowrap: bool = ...) -> snetio: ...
|
||||
@overload
|
||||
def disk_io_counters(perdisk: Literal[False] = ..., nowrap: bool = ...) -> sdiskio | None: ...
|
||||
@overload
|
||||
def disk_io_counters(perdisk: Literal[True], nowrap: bool = ...) -> dict[str, sdiskio]: ...
|
||||
@overload
|
||||
def net_io_counters(pernic: Literal[False] = ..., nowrap: bool = ...) -> snetio: ...
|
||||
@overload
|
||||
def net_io_counters(pernic: Literal[True], nowrap: bool = ...) -> dict[str, snetio]: ...
|
||||
def net_connections(kind: str = ...) -> list[sconn]: ...
|
||||
def net_if_addrs() -> dict[str, list[snicaddr]]: ...
|
||||
def net_if_stats() -> dict[str, snicstats]: ...
|
||||
|
||||
Reference in New Issue
Block a user