Skip to content

Commit 14c08fa

Browse files
committed
Tweak doc for bytes object
1 parent a4188ef commit 14c08fa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/source/bytes_object.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ follows::
1919
b = bytes(b'ABCD')
2020

2121
On 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

4343
Currently 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

0 commit comments

Comments
 (0)