@@ -110,6 +110,8 @@ __all__ = [
110110 "SupportsIndex" ,
111111 "SupportsInt" ,
112112 "SupportsRound" ,
113+ "Reader" ,
114+ "Writer" ,
113115 # One-off things.
114116 "Annotated" ,
115117 "assert_never" ,
@@ -136,6 +138,7 @@ __all__ = [
136138 "overload" ,
137139 "override" ,
138140 "Protocol" ,
141+ "Sentinel" ,
139142 "reveal_type" ,
140143 "runtime" ,
141144 "runtime_checkable" ,
@@ -446,6 +449,19 @@ else:
446449 @abc .abstractmethod
447450 def __round__ (self , ndigits : int , / ) -> _T_co : ...
448451
452+ if sys .version_info >= (3 , 14 ):
453+ from io import Reader as Reader , Writer as Writer
454+ else :
455+ @runtime_checkable
456+ class Reader (Protocol_ [T_co ]):
457+ @abc .abstractmethod
458+ def read (self , size : int = ..., / ) -> T_co : ...
459+
460+ @runtime_checkable
461+ class Writer (Protocol [_T_contra ]):
462+ @abc .abstractmethod
463+ def write (self , data : T_contra , / ) -> int : ...
464+
449465if sys .version_info >= (3 , 13 ):
450466 from types import CapsuleType as CapsuleType
451467 from typing import (
@@ -670,6 +686,9 @@ else:
670686 globals : Mapping [str , Any ] | None = None , # value types depend on the key
671687 locals : Mapping [str , Any ] | None = None , # value types depend on the key
672688 type_params : Iterable [TypeVar | ParamSpec | TypeVarTuple ] | None = None ,
673- format : Format = Format . VALUE , # noqa: Y011
689+ format : Format | None = None ,
674690 _recursive_guard : Container [str ] = ...,
675691 ) -> AnnotationForm : ...
692+
693+ # PEP 661
694+ Sentinel : _SpecialForm
0 commit comments