mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-70363: Implement io.IOBase
interface for SpooledTemporaryFile
(GH-29560)
Since the underlying file-like objects (either `io.BytesIO`, or a true file object) all implement the `io.IOBase` interface, the `SpooledTemporaryFile` should as well. Additionally, since the underlying file object will either be an instance of an `io.BufferedIOBase` (for binary mode) or an `io.TextIOBase` (for text mode), methods for these classes were also implemented. In every case, the required methods and properties are simply delegated to the underlying file object. Co-authored-by: Gary Fernie <Gary.Fernie@skyscanner.net> Co-authored-by: Inada Naoki <songofacandy@gmail.com>
This commit is contained in:
parent
52dc9c3066
commit
78e70be331
5 changed files with 92 additions and 3 deletions
|
@ -123,6 +123,11 @@ The module defines the following user-callable items:
|
|||
.. versionchanged:: 3.8
|
||||
Added *errors* parameter.
|
||||
|
||||
.. versionchanged:: 3.11
|
||||
Fully implements the :class:`io.BufferedIOBase` and
|
||||
:class:`io.TextIOBase` abstract base classes (depending on whether binary
|
||||
or text *mode* was specified).
|
||||
|
||||
|
||||
.. class:: TemporaryDirectory(suffix=None, prefix=None, dir=None, ignore_cleanup_errors=False)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue