@@ -2,7 +2,7 @@ import sys
2
2
from _typeshed import Incomplete
3
3
from collections .abc import Callable , Iterable , Iterator
4
4
from contextlib import AbstractContextManager
5
- from typing import Any , Literal , overload
5
+ from typing import Any , Literal , Protocol , overload , type_check_only
6
6
from typing_extensions import Self , TypeAlias , deprecated
7
7
8
8
from psutil ._common import (
@@ -234,11 +234,18 @@ class Popen(Process):
234
234
def __getattribute__ (self , name : str ) -> Any : ...
235
235
def __dir__ (self ) -> list [str ]: ...
236
236
237
+ @type_check_only
238
+ class _ProcessIterCallable (Protocol ):
239
+ def __call__ (
240
+ self , attrs : list [str ] | tuple [str , ...] | set [str ] | frozenset [str ] | None = None , ad_value = None
241
+ ) -> Iterator [Process ]: ...
242
+ def cache_clear (self ) -> None : ...
243
+
237
244
def pids () -> list [int ]: ...
238
245
def pid_exists (pid : int ) -> bool : ...
239
- def process_iter (
240
- attrs : list [ str ] | tuple [ str , ...] | set [ str ] | frozenset [ str ] | None = None , ad_value = None
241
- ) -> Iterator [ Process ]: ...
246
+
247
+ process_iter : _ProcessIterCallable
248
+
242
249
def wait_procs (
243
250
procs : Iterable [Process ], timeout : float | None = None , callback : Callable [[Process ], object ] | None = None
244
251
) -> tuple [list [Process ], list [Process ]]: ...
0 commit comments