From 8b7c9124df30f9472b3860fd986f3358b17de2bf Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 7 May 2022 13:14:11 +0100 Subject: [PATCH 1/2] gh-92417: `stdtypes` docs: shorten discussion of Python 2 differences Given that 2.7 has now been end-of-life for two and a half years, I don't think we need such a detailed explanation here anymore of the differences between Python 2 and Python 3. #92417 --- Doc/library/stdtypes.rst | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 44447400c29bca..202f8868da427f 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2574,14 +2574,10 @@ since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can always convert a bytes object into a list of integers using ``list(b)``. .. note:: - For Python 2.x users: In the Python 2.x series, a variety of implicit - conversions between 8-bit strings (the closest thing 2.x offers to a - built-in binary data type) and Unicode strings were permitted. This was a - backwards compatibility workaround to account for the fact that Python - originally only supported 8-bit text, and Unicode text was a later - addition. In Python 3.x, those implicit conversions are gone - conversions + In Python 3.x, conversions between 8-bit binary data and Unicode text must be explicit, and bytes and - string objects will always compare unequal. + string objects will always compare unequal. This differs from the behaviour + in Python 2.x. .. _typebytearray: From 144b16aa0091113f48ef2adef6d61c8bf7d93986 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sun, 8 May 2022 06:22:28 +0100 Subject: [PATCH 2/2] Delete the whole note --- Doc/library/stdtypes.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 202f8868da427f..065afb8ae6038b 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2573,12 +2573,6 @@ The representation of bytes objects uses the literal format (``b'...'``) since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can always convert a bytes object into a list of integers using ``list(b)``. -.. note:: - In Python 3.x, conversions - between 8-bit binary data and Unicode text must be explicit, and bytes and - string objects will always compare unequal. This differs from the behaviour - in Python 2.x. - .. _typebytearray: