io.Reader
Prev: io.RawIOBase | Up: io | Next: io.StringIO
Rel: io.BlockingIOError, io.BufferedIOBase, io.BufferedRandom, io.BufferedReader
Ref: docs.python.org — io.Reader
Tags: #public #python3 #stdlib #io
Import
import io
from io import Reader
Signature & Overview
io.Reader()
Protocol for simple I/O reader instances.
Methods & Attributes
Reader.read(self, size=Ellipsis, /)— Read data from the input stream and return it.
Usage
import io
# Python 3.14+ typing Protocol for readable streams
assert hasattr(io, "Reader")
Gotchas
- Python 3.14+ generic protocol (
io.Reader[T]): Use in type annotations when a function only needs.read(...)rather than a fullIOBasefile object.
REPL Inspect
from io import Reader
help(Reader)
Linked from
Related notes
- tuts/python3/stdlib_module/io/RawIOBase Linked here; links to this page; shared tags: #io, #stdlib
- tuts/python3/stdlib_module/io/StringIO 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