Skip to content

Commit fae0fe4

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 49e2421 commit fae0fe4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Doc/library/codecs.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ interfaces of the stateless encoder and decoder:
392392
handling.
393393

394394
The method may not store state in the :class:`Codec` instance. Use
395-
:class:`StreamCodec` for codecs which have to keep state in order to make
396-
encoding/decoding efficient.
395+
:class:`StreamWriter` for codecs which have to keep state in order to make
396+
encoding efficient.
397397

398398
The encoder must be able to handle zero length input and return an empty object
399399
of the output object type in this situation.
@@ -413,8 +413,8 @@ interfaces of the stateless encoder and decoder:
413413
handling.
414414

415415
The method may not store state in the :class:`Codec` instance. Use
416-
:class:`StreamCodec` for codecs which have to keep state in order to make
417-
encoding/decoding efficient.
416+
:class:`StreamReader` for codecs which have to keep state in order to make
417+
decoding efficient.
418418

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

Lib/codecs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ def encode(self, input, errors='strict'):
138138
'strict' handling.
139139
140140
The method may not store state in the Codec instance. Use
141-
StreamCodec for codecs which have to keep state in order to
142-
make encoding/decoding efficient.
141+
StreamWriter for codecs which have to keep state in order to
142+
make encoding efficient.
143143
144144
The encoder must be able to handle zero length input and
145145
return an empty object of the output object type in this
@@ -161,8 +161,8 @@ def decode(self, input, errors='strict'):
161161
'strict' handling.
162162
163163
The method may not store state in the Codec instance. Use
164-
StreamCodec for codecs which have to keep state in order to
165-
make encoding/decoding efficient.
164+
StreamReader for codecs which have to keep state in order to
165+
make decoding efficient.
166166
167167
The decoder must be able to handle zero length input and
168168
return an empty object of the output object type in this

0 commit comments

Comments
 (0)