|
| 1 | +import io |
1 | 2 | import os
|
2 | 3 | import sys
|
3 | 4 | from _typeshed import Self
|
@@ -219,7 +220,11 @@ class _TemporaryFileWrapper(Generic[AnyStr], IO[AnyStr]):
|
219 | 220 |
|
220 | 221 | # It does not actually derive from IO[AnyStr], but it does implement the
|
221 | 222 | # protocol.
|
222 |
| -class SpooledTemporaryFile(IO[AnyStr]): |
| 223 | +if sys.version_info >= (3, 11): |
| 224 | + _STFBase = io.IOBase |
| 225 | +else: |
| 226 | + _STFBase = object |
| 227 | +class SpooledTemporaryFile(IO[AnyStr], _STFBase): |
223 | 228 | @property
|
224 | 229 | def encoding(self) -> str: ... # undocumented
|
225 | 230 | @property
|
@@ -318,6 +323,13 @@ class SpooledTemporaryFile(IO[AnyStr]):
|
318 | 323 | def fileno(self) -> int: ...
|
319 | 324 | def flush(self) -> None: ...
|
320 | 325 | def isatty(self) -> bool: ...
|
| 326 | + if sys.version_info >= (3, 11): |
| 327 | + def readable(self) -> bool: ... |
| 328 | + def read1(self, __size: int = ...) -> AnyStr: ... |
| 329 | + def readinto(self, b: WriteableBuffer) -> int: ... |
| 330 | + def readinto1(self, b: WriteableBuffer) -> int: ... |
| 331 | + def seekable(self) -> bool: ... |
| 332 | + |
321 | 333 | def read(self, n: int = ...) -> AnyStr: ...
|
322 | 334 | def readline(self, limit: int = ...) -> AnyStr: ...
|
323 | 335 | def readlines(self, hint: int = ...) -> list[AnyStr]: ...
|
|
0 commit comments