mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-30 16:14:24 +08:00
Improve resource stubs for py3 (#1565)
This commit is contained in:
committed by
Łukasz Langa
parent
1c8f43b86c
commit
485c232409
@@ -2,7 +2,7 @@
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from typing import Tuple
|
||||
from typing import Tuple, Optional, NamedTuple
|
||||
|
||||
RLIMIT_AS = ... # type: int
|
||||
RLIMIT_CORE = ... # type: int
|
||||
@@ -25,7 +25,17 @@ RUSAGE_CHILDREN = ... # type: int
|
||||
RUSAGE_SELF = ... # type: int
|
||||
RUSAGE_THREAD = ... # type: int
|
||||
|
||||
_RUsage = NamedTuple('_RUsage', [('ru_utime', float), ('ru_stime', float), ('ru_maxrss', int),
|
||||
('ru_ixrss', int), ('ru_idrss', int), ('ru_isrss', int),
|
||||
('ru_minflt', int), ('ru_majflt', int), ('ru_nswap', int),
|
||||
('ru_inblock', int), ('ru_oublock', int), ('ru_msgsnd', int),
|
||||
('ru_msgrcv', int), ('ru_nsignals', int), ('ru_nvcsw', int),
|
||||
('ru_nivcsw', int)])
|
||||
|
||||
def getpagesize() -> int: ...
|
||||
def getrlimit(resource: int) -> Tuple[int, int]: ...
|
||||
def getrusage(who: int) -> _RUsage: ...
|
||||
def prlimit(pid: int, resource: int, limits: Optional[Tuple[int, int]]) -> Tuple[int, int]: ...
|
||||
def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ...
|
||||
|
||||
# NOTE: This is an alias of OSError in Python 3.3.
|
||||
|
||||
Reference in New Issue
Block a user