mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
[stdlib] Add overloads for sys.intern function for LiteralString inputs (#15034)
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user