[stdlib] Add overloads for sys.intern function for LiteralString inputs (#15034)

This commit is contained in:
Guo Ci
2025-11-15 15:44:51 -05:00
committed by GitHub
parent 63b498d240
commit ebce8d766b
+5 -2
View File
@@ -5,7 +5,7 @@ from builtins import object as _object
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 import Any, Final, Literal, NoReturn, Protocol, TextIO, TypeVar, final, overload, type_check_only
from typing_extensions import LiteralString, TypeAlias, deprecated
_T = TypeVar("_T")
@@ -422,7 +422,10 @@ if sys.platform == "win32":
def getwindowsversion() -> _WinVersion: ...
def intern(string: str, /) -> str: ...
@overload
def intern(string: LiteralString, /) -> LiteralString: ...
@overload
def intern(string: str, /) -> str: ... # type: ignore[misc]
__interactivehook__: Callable[[], object]