1
1
import sys
2
- from typing import Any , ContextManager
2
+ from typing import Any , Callable , ContextManager , Iterable , Iterator
3
3
4
4
from ._common import (
5
5
AIX as AIX ,
@@ -54,6 +54,17 @@ from ._common import (
54
54
popenfile ,
55
55
pthread ,
56
56
puids ,
57
+ sconn ,
58
+ scpufreq ,
59
+ scpustats ,
60
+ sdiskio ,
61
+ sdiskpart ,
62
+ sdiskusage ,
63
+ snetio ,
64
+ snicaddr ,
65
+ snicstats ,
66
+ sswap ,
67
+ suser ,
57
68
)
58
69
59
70
if sys .platform == "linux" :
@@ -154,26 +165,28 @@ class Popen(Process):
154
165
def __getattribute__ (self , name ): ...
155
166
def wait (self , timeout : Any | None = ...): ...
156
167
157
- def pids (): ...
158
- def pid_exists (pid ): ...
159
- def process_iter (attrs : Any | None = ..., ad_value : Any | None = ...): ...
160
- def wait_procs (procs , timeout : Any | None = ..., callback : Any | None = ...): ...
161
- def cpu_count (logical : bool = ...): ...
168
+ def pids () -> list [int ]: ...
169
+ def pid_exists (pid : int ) -> bool : ...
170
+ def process_iter (attrs : Any | None = ..., ad_value : Any | None = ...) -> Iterator [Process ]: ...
171
+ def wait_procs (
172
+ procs : Iterable [Process ], timeout : float | None = ..., callback : Callable [[Process ], Any ] | None = ...
173
+ ) -> tuple [list [Process ], list [Process ]]: ...
174
+ def cpu_count (logical : bool = ...) -> int : ...
162
175
def cpu_times (percpu : bool = ...): ...
163
- def cpu_percent (interval : Any | None = ..., percpu : bool = ...): ...
164
- def cpu_times_percent (interval : Any | None = ..., percpu : bool = ...): ...
165
- def cpu_stats (): ...
166
- def cpu_freq (percpu : bool = ...): ...
167
- def getloadavg (): ...
176
+ def cpu_percent (interval : float | None = ..., percpu : bool = ...) -> float : ...
177
+ def cpu_times_percent (interval : float | None = ..., percpu : bool = ...): ...
178
+ def cpu_stats () -> scpustats : ...
179
+ def cpu_freq (percpu : bool = ...) -> scpufreq : ...
180
+ def getloadavg () -> tuple [ float , float , float ] : ...
168
181
def virtual_memory (): ...
169
- def swap_memory (): ...
170
- def disk_usage (path ) : ...
171
- def disk_partitions (all : bool = ...): ...
172
- def disk_io_counters (perdisk : bool = ..., nowrap : bool = ...): ...
173
- def net_io_counters (pernic : bool = ..., nowrap : bool = ...): ...
174
- def net_connections (kind : str = ...): ...
175
- def net_if_addrs (): ...
176
- def net_if_stats (): ...
182
+ def swap_memory () -> sswap : ...
183
+ def disk_usage (path : str ) -> sdiskusage : ...
184
+ def disk_partitions (all : bool = ...) -> list [ sdiskpart ] : ...
185
+ def disk_io_counters (perdisk : bool = ..., nowrap : bool = ...) -> sdiskio : ...
186
+ def net_io_counters (pernic : bool = ..., nowrap : bool = ...) -> snetio : ...
187
+ def net_connections (kind : str = ...) -> list [ sconn ] : ...
188
+ def net_if_addrs () -> dict [ str , list [ snicaddr ]] : ...
189
+ def net_if_stats () -> dict [ str , snicstats ] : ...
177
190
178
191
if sys .platform == "linux" :
179
192
def sensors_temperatures (fahrenheit : bool = ...): ...
@@ -182,8 +195,8 @@ if sys.platform == "linux":
182
195
if sys .platform != "win32" :
183
196
def sensors_battery (): ...
184
197
185
- def boot_time (): ...
186
- def users (): ...
198
+ def boot_time () -> float : ...
199
+ def users () -> list [ suser ] : ...
187
200
188
201
if sys .platform == "linux" :
189
202
RLIMIT_AS : int
0 commit comments