Skip to content

Commit 297fd87

Browse files
scopvstinner
authored andcommitted
bpo-28393: Update encoding lookup docs wrt bpo-27938 (#4871)
1 parent e425bd7 commit 297fd87

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Doc/library/codecs.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -977,10 +977,14 @@ e.g. ``'utf-8'`` is a valid alias for the ``'utf_8'`` codec.
977977

978978
Some common encodings can bypass the codecs lookup machinery to
979979
improve performance. These optimization opportunities are only
980-
recognized by CPython for a limited set of aliases: utf-8, utf8,
981-
latin-1, latin1, iso-8859-1, mbcs (Windows only), ascii, utf-16,
982-
and utf-32. Using alternative spellings for these encodings may
983-
result in slower execution.
980+
recognized by CPython for a limited set of (case insensitive)
981+
aliases: utf-8, utf8, latin-1, latin1, iso-8859-1, iso8859-1, mbcs
982+
(Windows only), ascii, us-ascii, utf-16, utf16, utf-32, utf32, and
983+
the same using underscores instead of dashes. Using alternative
984+
aliases for these encodings may result in slower execution.
985+
986+
.. versionchanged:: 3.6
987+
Optimization opportunity recognized for us-ascii.
984988

985989
Many of the character sets support the same languages. They vary in individual
986990
characters (e.g. whether the EURO SIGN is supported or not), and in the

0 commit comments

Comments
 (0)