[docs] [issue27949] Fix description in bytes literal doc

Eric V. Smith report at bugs.python.org
Sat Sep 3 10:54:45 EDT 2016


Eric V. Smith added the comment:

While they probably should be entered with escapes, there's no actual technical requirement for that.

>From the command line, I can enter a control-A with control-V control-A (this might be different depending on your environment, or if you use an editor). This will enter a literal string containing a single character with value 1.

That gives:

>>> '^A'     # ^A is the combination control-V control-A
'\x01'
>>> len('^A')
1
>>> ord('^A')
1
>>> b'^A'
b'\x01'

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27949>
_______________________________________


More information about the docs mailing list