@@ -164,6 +164,39 @@ else:
164164 dir : Optional [_DirT [AnyStr ]] = ...,
165165 ) -> IO [Any ]: ...
166166
167+ class _TemporaryFileWrapper (IO [str ]):
168+ file : IO [str ]
169+ name : Any
170+ delete : bool
171+ def __init__ (self , file : IO [str ], name : Any , delete : bool = ...) -> None : ...
172+ def __enter__ (self ) -> _TemporaryFileWrapper : ...
173+ def __exit__ (
174+ self , exc : Optional [Type [BaseException ]], value : Optional [BaseException ], tb : Optional [TracebackType ]
175+ ) -> Optional [bool ]: ...
176+ def __getattr__ (self , name : str ) -> Any : ...
177+ def close (self ) -> None : ...
178+ def unlink (self , path : str ) -> None : ...
179+ # These methods don't exist directly on this object, but
180+ # are delegated to the underlying IO object through __getattr__.
181+ # We need to add them here so that this class is concrete.
182+ def __iter__ (self ) -> Iterator [str ]: ...
183+ def __next__ (self ) -> str : ...
184+ def fileno (self ) -> int : ...
185+ def flush (self ) -> None : ...
186+ def isatty (self ) -> bool : ...
187+ def next (self ) -> str : ...
188+ def read (self , n : int = ...) -> str : ...
189+ def readable (self ) -> bool : ...
190+ def readline (self , limit : int = ...) -> str : ...
191+ def readlines (self , hint : int = ...) -> List [str ]: ...
192+ def seek (self , offset : int , whence : int = ...) -> int : ...
193+ def seekable (self ) -> bool : ...
194+ def tell (self ) -> int : ...
195+ def truncate (self , size : Optional [int ] = ...) -> int : ...
196+ def writable (self ) -> bool : ...
197+ def write (self , s : str ) -> int : ...
198+ def writelines (self , lines : Iterable [str ]) -> None : ...
199+
167200# It does not actually derive from IO[AnyStr], but it does implement the
168201# protocol.
169202class SpooledTemporaryFile (IO [AnyStr ]):
0 commit comments