From 614e9499f145e9dccade16d906247276f1d5e6aa Mon Sep 17 00:00:00 2001 From: David Peter Date: Thu, 9 Jan 2025 18:58:44 +0100 Subject: [PATCH] Annotate `sys.platform` as `LiteralString` (#13378) --- stdlib/sys/__init__.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/sys/__init__.pyi b/stdlib/sys/__init__.pyi index 5695ca256..d11e64d10 100644 --- a/stdlib/sys/__init__.pyi +++ b/stdlib/sys/__init__.pyi @@ -6,7 +6,7 @@ from collections.abc import AsyncGenerator, Callable, Sequence from io import TextIOWrapper from types import FrameType, ModuleType, TracebackType from typing import Any, Final, Literal, NoReturn, Protocol, TextIO, TypeVar, final, type_check_only -from typing_extensions import TypeAlias +from typing_extensions import LiteralString, TypeAlias _T = TypeVar("_T") @@ -45,7 +45,7 @@ if sys.version_info >= (3, 10): path: list[str] path_hooks: list[Callable[[str], PathEntryFinderProtocol]] path_importer_cache: dict[str, PathEntryFinderProtocol | None] -platform: str +platform: LiteralString if sys.version_info >= (3, 9): platlibdir: str prefix: str