On this page
codecs.iterencode
Prev: codecs.iterdecode | Up: codecs | Next: codecs.lookup
Rel: codecs.backslashreplace_errors, codecs.Codec, codecs.CodecInfo, codecs.decode
Ref: docs.python.org — codecs.iterencode
Tags: #public #python3 #stdlib #codecs
Import
import codecs
from codecs import iterencode
Signature & Overview
codecs.iterencode(iterator, encoding, errors='strict', **kwargs)
Encoding iterator.
Usage
import codecs
raw = b"".join(codecs.iterencode(["caf", "é"], "utf-8"))
assert raw == "café".encode("utf-8")
Gotchas
- Lazily encodes an iterable of strings using an
IncrementalEncoder.
REPL Inspect
from codecs import iterencode
help(iterencode)
Linked from
Related notes
- tuts/python3/stdlib_module/codecs/iterdecode Linked here; links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/lookup Linked here; links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/codecs/backslashreplace_errors Linked here; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/Codec Linked here; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/CodecInfo Linked here; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/decode Linked here; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/encode shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/EncodedFile shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/getdecoder shared tags: #codecs, #stdlib