mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-08 22:36:18 +08:00
[_io] Limit io.text_encoding argument to str | None (#15663)
This commit is contained in:
+2
-2
@@ -9,7 +9,7 @@ from types import TracebackType
|
||||
from typing import IO, Any, BinaryIO, Final, Generic, Literal, Protocol, TextIO, TypeVar, overload, type_check_only
|
||||
from typing_extensions import Self, disjoint_base
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_S = TypeVar("_S", bound=str)
|
||||
|
||||
if sys.version_info >= (3, 14):
|
||||
DEFAULT_BUFFER_SIZE: Final = 131072
|
||||
@@ -298,4 +298,4 @@ if sys.version_info >= (3, 10):
|
||||
@overload
|
||||
def text_encoding(encoding: None, stacklevel: int = 2, /) -> Literal["locale", "utf-8"]: ...
|
||||
@overload
|
||||
def text_encoding(encoding: _T, stacklevel: int = 2, /) -> _T: ...
|
||||
def text_encoding(encoding: _S, stacklevel: int = 2, /) -> _S: ...
|
||||
|
||||
Reference in New Issue
Block a user