mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Improve pty.pyi (#6806)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
import sys
|
||||
from typing import Callable, Iterable
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.platform != "win32":
|
||||
__all__ = ["openpty", "fork", "spawn"]
|
||||
_Reader = Callable[[int], bytes]
|
||||
|
||||
STDIN_FILENO: int
|
||||
STDOUT_FILENO: int
|
||||
STDERR_FILENO: int
|
||||
STDIN_FILENO: Literal[0]
|
||||
STDOUT_FILENO: Literal[1]
|
||||
STDERR_FILENO: Literal[2]
|
||||
|
||||
CHILD: int
|
||||
CHILD: Literal[0]
|
||||
def openpty() -> tuple[int, int]: ...
|
||||
def master_open() -> tuple[int, str]: ...
|
||||
def slave_open(tty_name: str) -> int: ...
|
||||
def master_open() -> tuple[int, str]: ... # deprecated, use openpty()
|
||||
def slave_open(tty_name: str) -> int: ... # deprecated, use openpty()
|
||||
def fork() -> tuple[int, int]: ...
|
||||
def spawn(argv: str | Iterable[str], master_read: _Reader = ..., stdin_read: _Reader = ...) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user