File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ follows::
19
19
b = bytes(b'ABCD')
20
20
21
21
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 ::
24
24
25
25
>>> b + u'EFGH' # TypeError
26
26
Traceback (most recent call last):
@@ -41,8 +41,8 @@ behaviours to Python 3's :class:`bytes`::
41
41
assert b.split(b'b') == [b'A', b'CD']
42
42
43
43
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::
46
46
47
47
from future.builtins import *
48
48
You can’t perform that action at this time.
0 commit comments