Skip to content
Merged
2 changes: 1 addition & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ stubdefaulter==0.1.0; python_version < "3.14"
termcolor>=2.3
tomli==2.2.1
tomlkit==0.13.2
typing_extensions>=4.13.0rc1
typing_extensions>=4.14.0rc1
uv==0.7.4

# Utilities for typeshed infrastructure scripts.
Expand Down
21 changes: 20 additions & 1 deletion stdlib/typing_extensions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@
"SupportsIndex",
"SupportsInt",
"SupportsRound",
"Reader",
"Writer",
# One-off things.
"Annotated",
"assert_never",
Expand All @@ -136,6 +138,7 @@
"overload",
"override",
"Protocol",
"Sentinel",
"reveal_type",
"runtime",
"runtime_checkable",
Expand Down Expand Up @@ -446,6 +449,19 @@
@abc.abstractmethod
def __round__(self, ndigits: int, /) -> _T_co: ...

if sys.version_info >= (3, 14):
from io import Reader as Reader, Writer as Writer
else:
@runtime_checkable
class Reader(Protocol_[T_co]):

Check failure on line 456 in stdlib/typing_extensions.pyi

View workflow job for this annotation

GitHub Actions / pyright: Run test cases (Linux, 3.13)

"Protocol_" is not defined (reportUndefinedVariable)

Check failure on line 456 in stdlib/typing_extensions.pyi

View workflow job for this annotation

GitHub Actions / pyright: Run test cases (Linux, 3.13)

Base class type is unknown, obscuring type of derived class (reportUntypedBaseClass)

Check failure on line 456 in stdlib/typing_extensions.pyi

View workflow job for this annotation

GitHub Actions / pyright: Run test cases (Linux, 3.13)

"T_co" is not defined (reportUndefinedVariable)
@abc.abstractmethod
def read(self, size: int = ..., /) -> T_co: ...

Check failure on line 458 in stdlib/typing_extensions.pyi

View workflow job for this annotation

GitHub Actions / pyright: Run test cases (Linux, 3.13)

"T_co" is not defined (reportUndefinedVariable)

@runtime_checkable
class Writer(Protocol[_T_contra]):

Check failure on line 461 in stdlib/typing_extensions.pyi

View workflow job for this annotation

GitHub Actions / pyright: Run test cases (Linux, 3.13)

"_T_contra" is not defined (reportUndefinedVariable)

Check failure on line 461 in stdlib/typing_extensions.pyi

View workflow job for this annotation

GitHub Actions / pyright: Run test cases (Linux, 3.13)

Type argument for "Protocol" must be a type parameter (reportInvalidTypeForm)
@abc.abstractmethod
def write(self, data: T_contra, /) -> int: ...

Check failure on line 463 in stdlib/typing_extensions.pyi

View workflow job for this annotation

GitHub Actions / pyright: Run test cases (Linux, 3.13)

"T_contra" is not defined (reportUndefinedVariable)

if sys.version_info >= (3, 13):
from types import CapsuleType as CapsuleType
from typing import (
Expand Down Expand Up @@ -670,6 +686,9 @@
globals: Mapping[str, Any] | None = None, # value types depend on the key
locals: Mapping[str, Any] | None = None, # value types depend on the key
type_params: Iterable[TypeVar | ParamSpec | TypeVarTuple] | None = None,
format: Format = Format.VALUE, # noqa: Y011
format: Format | None = None,
_recursive_guard: Container[str] = ...,
) -> AnnotationForm: ...

# PEP 661
Sentinel: _SpecialForm
Loading