[docs] [issue13744] raw byte strings are described in a confusing way
Barry A. Warsaw
report at bugs.python.org
Mon Jan 9 14:34:22 CET 2012
New submission from Barry A. Warsaw <barry at python.org>:
The lexical analysis documentation says this:
"Bytes literals are always prefixed with 'b' or 'B';..."
"Both string and bytes literals may optionally be prefixed with a letter 'r' or 'R';..."
But that would lead you to believe that to get raw byte strings you should use rb"foo". In fact, that's a SyntaxError in Python 2.6+ and Python 3. What *does* work though is br"foo".
Either Python should accept both spellings (harder) or the documentation should make it clear that the 'b' must preceded the 'r'.
assignee: docs at python
nosy: barry, docs at python
title: raw byte strings are described in a confusing way
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3
Python tracker <report at bugs.python.org>
More information about the docs