[issue44308] Raw Strings lack parody

Steven D'Aprano report at bugs.python.org
Fri Jun 4 01:11:15 EDT 2021


Steven D'Aprano <steve+python at pearwood.info> added the comment:

I think you have missed something important here:

    >>> data = b'foo\bar'
    >>> len(data)
    6
    >>> print(data)
    b'foo\x08ar'


If you want bytes including a backslash followed by a b, you need to use raw bytes rb'foo\bar' or escape the backslash.

Also Python 3.8 is in feature-freeze so the earliest this new feature could be added to the language is now 3.11.

----------
nosy: +steven.daprano
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44308>
_______________________________________


More information about the Python-bugs-list mailing list