mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Use Final for Constant Literals in the stdlib (#12332)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping
|
||||
from types import TracebackType
|
||||
from typing import Any, Generic, Literal, TypeVar
|
||||
from typing import Any, Final, Generic, TypeVar
|
||||
from typing_extensions import Self
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -97,7 +97,7 @@ class ThreadPool(Pool):
|
||||
) -> None: ...
|
||||
|
||||
# undocumented
|
||||
INIT: Literal["INIT"]
|
||||
RUN: Literal["RUN"]
|
||||
CLOSE: Literal["CLOSE"]
|
||||
TERMINATE: Literal["TERMINATE"]
|
||||
INIT: Final = "INIT"
|
||||
RUN: Final = "RUN"
|
||||
CLOSE: Final = "CLOSE"
|
||||
TERMINATE: Final = "TERMINATE"
|
||||
|
||||
@@ -8,7 +8,7 @@ from copyreg import _DispatchTableType
|
||||
from multiprocessing import connection
|
||||
from pickle import _ReducedType
|
||||
from socket import socket
|
||||
from typing import Any, Literal
|
||||
from typing import Any, Final
|
||||
|
||||
if sys.platform == "win32":
|
||||
__all__ = ["send_handle", "recv_handle", "ForkingPickler", "register", "dump", "DupHandle", "duplicate", "steal_handle"]
|
||||
@@ -43,10 +43,7 @@ if sys.platform == "win32":
|
||||
def detach(self) -> int: ...
|
||||
|
||||
else:
|
||||
if sys.platform == "darwin":
|
||||
ACKNOWLEDGE: Literal[True]
|
||||
else:
|
||||
ACKNOWLEDGE: Literal[False]
|
||||
ACKNOWLEDGE: Final[bool]
|
||||
|
||||
def recvfds(sock: socket, size: int) -> list[int]: ...
|
||||
def send_handle(conn: HasFileno, handle: int, destination_pid: Unused) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user