mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Add multiprocessing.resource_sharer submodule (#8413)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
25
stdlib/multiprocessing/resource_sharer.pyi
Normal file
25
stdlib/multiprocessing/resource_sharer.pyi
Normal file
@@ -0,0 +1,25 @@
|
||||
import sys
|
||||
from socket import socket
|
||||
from typing import Union
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
__all__ = ["stop"]
|
||||
|
||||
# https://docs.python.org/3/library/multiprocessing.html#address-formats
|
||||
_Address: TypeAlias = Union[str, tuple[str, int]]
|
||||
|
||||
if sys.platform == "win32":
|
||||
__all__ += ["DupSocket"]
|
||||
|
||||
class DupSocket:
|
||||
def __init__(self, sock: socket) -> None: ...
|
||||
def detach(self) -> socket: ...
|
||||
|
||||
else:
|
||||
__all__ += ["DupFd"]
|
||||
|
||||
class DupFd:
|
||||
def __init__(self, fd: int) -> None: ...
|
||||
def detach(self) -> int: ...
|
||||
|
||||
def stop(timeout: float | None = ...) -> None: ...
|
||||
Reference in New Issue
Block a user