io.Writer
Prev: io.UnsupportedOperation | Up: io
Rel: io.BlockingIOError, io.BufferedIOBase, io.BufferedRandom, io.BufferedReader
Ref: docs.python.org — io.Writer
Tags: #public #python3 #stdlib #io
Import
import io
from io import Writer
Signature & Overview
io.Writer()
Protocol for simple I/O writer instances.
Methods & Attributes
Writer.write(self, data, /)— Write data to the output stream and return the number of items written.
Usage
import io
# Python 3.14+ typing Protocol for writable streams
assert hasattr(io, "Writer")
Gotchas
- Python 3.14+ generic protocol (
io.Writer[T]): Use in type annotations when a function only needs.write(...).
REPL Inspect
from io import Writer
help(Writer)
Linked from
Related notes
- tuts/python3/stdlib_module/io/UnsupportedOperation Linked here; links to this page; shared tags: #io, #stdlib
- tuts/python3/stdlib_module/io Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/io/BlockingIOError Linked here; shared tags: #io, #stdlib
- tuts/python3/stdlib_module/io/BufferedIOBase Linked here; shared tags: #io, #stdlib
- tuts/python3/stdlib_module/io/BufferedRandom Linked here; shared tags: #io, #stdlib
- tuts/python3/stdlib_module/io/BufferedReader Linked here; shared tags: #io, #stdlib
- tuts/c/stdlib/stdio_and_file_io shared tags: #io, #stdlib
- tuts/cpp/stdlib/io_and_filesystem shared tags: #io, #stdlib
- tuts/cpp/stdlib/io_and_filesystem/format_and_print shared tags: #io, #stdlib
- tuts/cpp/stdlib/io_and_filesystem/iostream shared tags: #io, #stdlib