Use Final for undocumented constants (#12450)

This commit is contained in:
Max Muoto
2024-07-28 05:02:06 -05:00
committed by GitHub
parent 1f4d0a815f
commit 9a77f6006d
10 changed files with 60 additions and 61 deletions

View File

@@ -2,7 +2,7 @@ import sys
from _typeshed import ReadableBuffer, StrOrBytesPath
from collections.abc import Callable, Collection, Iterable, Mapping, Sequence
from types import TracebackType
from typing import IO, Any, AnyStr, Generic, Literal, TypeVar, overload
from typing import IO, Any, AnyStr, Final, Generic, Literal, TypeVar, overload
from typing_extensions import Self, TypeAlias
if sys.version_info >= (3, 9):
@@ -74,8 +74,8 @@ _T = TypeVar("_T")
# These two are private but documented
if sys.version_info >= (3, 11):
_USE_VFORK: bool
_USE_POSIX_SPAWN: bool
_USE_VFORK: Final[bool]
_USE_POSIX_SPAWN: Final[bool]
class CompletedProcess(Generic[_T]):
# morally: _CMD
@@ -1810,9 +1810,9 @@ else:
text: bool | None = None,
) -> Any: ... # morally: -> str | bytes
PIPE: int
STDOUT: int
DEVNULL: int
PIPE: Final[int]
STDOUT: Final[int]
DEVNULL: Final[int]
class SubprocessError(Exception): ...