Skip to content

Commit 41ca828

Browse files
committed
Issue #12160: Fix incorrect StreamCodec references in Codec.encode() and Codec.decode() docs.
It should StreamWriter for Codecs.encode() and StreamReader for Codec.decode(). Patch by Nick Weinhold.
1 parent dcf841b commit 41ca828

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Doc/library/codecs.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ function interfaces of the stateless encoder and decoder:
436436
It defaults to ``'strict'`` handling.
437437

438438
The method may not store state in the :class:`Codec` instance. Use
439-
:class:`StreamCodec` for codecs which have to keep state in order to make
440-
encoding/decoding efficient.
439+
:class:`StreamWriter` for codecs which have to keep state in order to make
440+
encoding efficient.
441441

442442
The encoder must be able to handle zero length input and return an empty object
443443
of the output object type in this situation.
@@ -458,8 +458,8 @@ function interfaces of the stateless encoder and decoder:
458458
It defaults to ``'strict'`` handling.
459459

460460
The method may not store state in the :class:`Codec` instance. Use
461-
:class:`StreamCodec` for codecs which have to keep state in order to make
462-
encoding/decoding efficient.
461+
:class:`StreamReader` for codecs which have to keep state in order to make
462+
decoding efficient.
463463

464464
The decoder must be able to handle zero length input and return an empty object
465465
of the output object type in this situation.

Lib/codecs.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ def encode(self, input, errors='strict'):
141141
'strict' handling.
142142
143143
The method may not store state in the Codec instance. Use
144-
StreamCodec for codecs which have to keep state in order to
145-
make encoding/decoding efficient.
144+
StreamWriter for codecs which have to keep state in order to
145+
make encoding efficient.
146146
147147
The encoder must be able to handle zero length input and
148148
return an empty object of the output object type in this
@@ -164,8 +164,8 @@ def decode(self, input, errors='strict'):
164164
'strict' handling.
165165
166166
The method may not store state in the Codec instance. Use
167-
StreamCodec for codecs which have to keep state in order to
168-
make encoding/decoding efficient.
167+
StreamReader for codecs which have to keep state in order to
168+
make decoding efficient.
169169
170170
The decoder must be able to handle zero length input and
171171
return an empty object of the output object type in this

0 commit comments

Comments
 (0)