File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ follows::
1919 b = bytes(b'ABCD')
2020
2121On Py2, this object inherits from Python 2's :class: `str `, but it
22- enforces the much stricter separation from unicode strings that Python
23- 3's :class: `bytes ` requires ::
22+ enforces the same strict strict separation of unicode strings and byte
23+ strings as Python 3's :class: `bytes ` object ::
2424
2525 >>> b + u'EFGH' # TypeError
2626 Traceback (most recent call last):
@@ -41,8 +41,8 @@ behaviours to Python 3's :class:`bytes`::
4141 assert b.split(b'b') == [b'A', b'CD']
4242
4343Currently the easiest way to ensure identical use of byte-strings
44- compatibly between Python 3 and 2 is to wrap all byte-string literals
45- `` b'...' `` in a :func: `~bytes()` ` call, as follows::
44+ in a Py3/2 codebase is to wrap all byte-string literals `` b'...' `` in a
45+ :func: `~bytes ` call, as follows::
4646
4747 from future.builtins import *
4848
You can’t perform that action at this time.
0 commit comments