On this page
typing.ByteString
Prev: typing.BinaryIO | Up: typing | Next: typing.Callable
Rel: typing.AbstractSet, typing.Annotated, typing.Any, typing.assert_never
Ref: docs.python.org — typing.ByteString
Tags: #public #python3 #stdlib #typing
Import
import typing
from typing import ByteString
Signature & Overview
typing.ByteString(*args, **kwargs)
Deprecated alias to collections.abc.ByteString.
Usage
from typing import ByteString
# Deprecated alias for bytes | bytearray | memoryview (removed in Python 3.14)
assert ByteString is not None
Gotchas
- Deprecated (scheduled for removal): Use
collections.abc.Buffer(Python 3.12+) orbytes | bytearray | memoryviewinstead.
REPL Inspect
from typing import ByteString
help(ByteString)
Linked from
Related notes
- tuts/python3/stdlib_module/typing/BinaryIO Linked here; links to this page; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/Callable Linked here; links to this page; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/typing/AbstractSet Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/Annotated Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/Any Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/assert_never Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/assert_type shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/AsyncContextManager shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/AsyncGenerator shared tags: #stdlib, #typing