The are a couple of paragraphs about error-checking behaviour for str.encode and str.decode that appears in a few versions of Python and could potentially be improved in future versions.
As found in the
Python 3.9.14 documentation for std.encode
:
By default, the errors argument is not checked for best performances, but only used at the first encoding error. Enable the
, or use a debug build to check errors.
The paragraph before that is fairly dense - there could be an opportunity to improve both of them.
Linked PRs
gh-99991: improve docs on str.encode and bytes.decode #100198
[3.11] gh-99991: improve docs on str.encode and bytes.decode (GH-100198) #100382
[3.10] gh-99991: improve docs on str.encode and bytes.decode (GH-100198) #100383