Skip to content

Commit 7e94e8e

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.
2 parents 4333d8b + 41ca828 commit 7e94e8e

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
@@ -454,8 +454,8 @@ function interfaces of the stateless encoder and decoder:
454454
It defaults to ``'strict'`` handling.
455455

456456
The method may not store state in the :class:`Codec` instance. Use
457-
:class:`StreamCodec` for codecs which have to keep state in order to make
458-
encoding/decoding efficient.
457+
:class:`StreamWriter` for codecs which have to keep state in order to make
458+
encoding efficient.
459459

460460
The encoder must be able to handle zero length input and return an empty object
461461
of the output object type in this situation.
@@ -476,8 +476,8 @@ function interfaces of the stateless encoder and decoder:
476476
It defaults to ``'strict'`` handling.
477477

478478
The method may not store state in the :class:`Codec` instance. Use
479-
:class:`StreamCodec` for codecs which have to keep state in order to make
480-
encoding/decoding efficient.
479+
:class:`StreamReader` for codecs which have to keep state in order to make
480+
decoding efficient.
481481

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

Lib/codecs.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ def encode(self, input, errors='strict'):
143143
'strict' handling.
144144
145145
The method may not store state in the Codec instance. Use
146-
StreamCodec for codecs which have to keep state in order to
147-
make encoding/decoding efficient.
146+
StreamWriter for codecs which have to keep state in order to
147+
make encoding efficient.
148148
149149
The encoder must be able to handle zero length input and
150150
return an empty object of the output object type in this
@@ -166,8 +166,8 @@ def decode(self, input, errors='strict'):
166166
'strict' handling.
167167
168168
The method may not store state in the Codec instance. Use
169-
StreamCodec for codecs which have to keep state in order to
170-
make encoding/decoding efficient.
169+
StreamReader for codecs which have to keep state in order to
170+
make decoding efficient.
171171
172172
The decoder must be able to handle zero length input and
173173
return an empty object of the output object type in this

0 commit comments

Comments
 (0)