New submission from Nicholas Willhite <willhite.nicho...@gmail.com>:
I'm really sure this isn't filed correctly. I'm a total noob to this process, so feel free to redirect me. :) Bytes can be defined as a function, or a prefixed series. You can prefix a series with "b" and get the expected data type. You can also use the builtin functions "bytes" to get the same structure: bytes('foo\bar', 'utf-8') == b'foo\bar' True But there's no builtin function for r'foo\bar' that gives you 'foo\\bar'. This would be really handy for applications that accept a regular expression. If that regex was part of the source code, I'd just r'foo\bar' to get the expected string. Being able to accept something like bytes and do: data = b'foo\bar' raw_string(data) 'foo\\bar' would be really useful for applications that accept a regex as input. Is there an obvious way to do this that I'm not seeing? Has my google-foo failed me? Feels like a function that should exist in the stdlib. Again, really sure I'm not "doing this correctly." So please direct me! :) Appreciative, -Nick Willhite ---------- components: Unicode messages: 395064 nosy: Nicholas Willhite, ezio.melotti, vstinner priority: normal severity: normal status: open title: Raw Strings lack parody type: behavior versions: Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44308> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com