codecs.getincrementalencoder
Prev: codecs.getincrementaldecoder | Up: codecs | Next: codecs.getreader
Rel: codecs.backslashreplace_errors, codecs.Codec, codecs.CodecInfo, codecs.decode
Ref: docs.python.org — codecs.getincrementalencoder
Tags: #public #python3 #stdlib #codecs
Import
import codecs
from codecs import getincrementalencoder
Signature & Overview
codecs.getincrementalencoder(encoding)
Lookup up the codec for the given encoding and return its IncrementalEncoder class or factory function.
Usage
import codecs
cls = codecs.getincrementalencoder("utf-8")
assert cls().encode("ok", final=True) == b"ok"
Gotchas
- Returns a factory: Instantiate once per stream.
REPL Inspect
from codecs import getincrementalencoder
help(getincrementalencoder)
Linked from
Related notes
- tuts/python3/stdlib_module/codecs/getincrementaldecoder Linked here; links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/getreader 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