[issue44308] Raw Strings lack parody

Mark Dickinson report at bugs.python.org
Fri Jun 4 07:58:32 EDT 2021


Mark Dickinson <dickinsm at gmail.com> added the comment:

> But there's no builtin function for r'foo\bar' that gives you 'foo\\bar'.

I'm confused about what's being requested here. r'foo\bar' and 'foo\\bar' are different source code representations of the exact same string (same type, same contents), so the identity function is such a function.

>>> f(r'foo\bar') == 'foo\\bar'
True

Nicholas: presumably you're after something more than the identity function. Can you clarify what the input and output types to your proposed function would be, and then give example input and output values?

----------
nosy: +mark.dickinson

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


More information about the Python-bugs-list mailing list