Skip to content

Commit d7a5a14

Browse files
authored
psutil: types for virtual_memory (#8501)
1 parent 64bc059 commit d7a5a14

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

stubs/psutil/psutil/__init__.pyi

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,15 @@ if sys.platform == "win32":
102102
)
103103

104104
if sys.platform == "linux":
105-
from ._pslinux import pfullmem, pmem
105+
from ._pslinux import pfullmem, pmem, svmem
106106
elif sys.platform == "darwin":
107-
from ._psosx import pfullmem, pmem
107+
from ._psosx import pfullmem, pmem, svmem
108108
elif sys.platform == "win32":
109-
from ._pswindows import pfullmem, pmem
109+
from ._pswindows import pfullmem, pmem, svmem
110110
else:
111111
class pmem(Any): ...
112112
class pfullmem(Any): ...
113+
class svmem(Any): ...
113114

114115
if sys.platform == "linux":
115116
PROCFS_PATH: str
@@ -220,7 +221,7 @@ def cpu_times_percent(interval: float | None = ..., percpu: bool = ...): ...
220221
def cpu_stats() -> scpustats: ...
221222
def cpu_freq(percpu: bool = ...) -> scpufreq: ...
222223
def getloadavg() -> tuple[float, float, float]: ...
223-
def virtual_memory(): ...
224+
def virtual_memory() -> svmem: ...
224225
def swap_memory() -> sswap: ...
225226
def disk_usage(path: str) -> sdiskusage: ...
226227
def disk_partitions(all: bool = ...) -> list[sdiskpart]: ...

stubs/psutil/psutil/_psbsd.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class sdiskio(NamedTuple):
8585
write_time: Any
8686
busy_time: Any
8787

88-
def virtual_memory(): ...
88+
def virtual_memory() -> svmem: ...
8989
def swap_memory(): ...
9090
def cpu_times(): ...
9191
def per_cpu_times(): ...

stubs/psutil/psutil/_pslinux.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ scputimes: Any
121121
prlimit: Any
122122

123123
def calculate_avail_vmem(mems): ...
124-
def virtual_memory(): ...
124+
def virtual_memory() -> svmem: ...
125125
def swap_memory(): ...
126126
def cpu_times(): ...
127127
def per_cpu_times(): ...

stubs/psutil/psutil/_psosx.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class pmem(NamedTuple):
4343

4444
pfullmem: Any
4545

46-
def virtual_memory(): ...
46+
def virtual_memory() -> svmem: ...
4747
def swap_memory(): ...
4848
def cpu_times(): ...
4949
def per_cpu_times(): ...

stubs/psutil/psutil/_pswindows.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class pio(NamedTuple):
101101
def convert_dos_path(s): ...
102102
def py2_strencode(s): ...
103103
def getpagesize(): ...
104-
def virtual_memory(): ...
104+
def virtual_memory() -> svmem: ...
105105
def swap_memory(): ...
106106

107107
disk_io_counters: Any

0 commit comments

Comments
 (0)