Use Final for Constant Literals in the stdlib (#12332)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Max Muoto
2024-07-15 12:07:34 -05:00
committed by GitHub
parent 02b05d67c4
commit 0df6028dc8
41 changed files with 569 additions and 572 deletions

View File

@@ -1,17 +1,17 @@
import sys
from collections.abc import Callable, Iterable
from typing import Literal
from typing import Final
from typing_extensions import TypeAlias
if sys.platform != "win32":
__all__ = ["openpty", "fork", "spawn"]
_Reader: TypeAlias = Callable[[int], bytes]
STDIN_FILENO: Literal[0]
STDOUT_FILENO: Literal[1]
STDERR_FILENO: Literal[2]
STDIN_FILENO: Final = 0
STDOUT_FILENO: Final = 1
STDERR_FILENO: Final = 2
CHILD: Literal[0]
CHILD: Final = 0
def openpty() -> tuple[int, int]: ...
def master_open() -> tuple[int, str]: ... # deprecated, use openpty()
def slave_open(tty_name: str) -> int: ... # deprecated, use openpty()