[Python-ideas] Re: Deprecate misleading escapes in strings

2023-02-16 Thread Ben Rudiak-Gould
On Thu, Feb 16, 2023 at 8:09 AM Barry wrote: > This is valid and does not match your rules. ‘\x9b’ that is the ANSI CSI > in 8-bit. > In 7-bit it is ‘\x1b[‘. > Shouldn't that be b‘\x9b’? ___ Python-ideas mailing list -- python-ideas@python.org To

[Python-ideas] Re: Deprecate misleading escapes in strings

2023-02-16 Thread Chris Angelico
On Fri, 17 Feb 2023 at 06:11, Arusekk wrote: > > W dniu 16.02.2023 o 17:55, David Mertz, Ph.D. pisze: > > Wow! That would break SO MUCH of the code I've written! E.g.: > > > > translate = {"el": "ἐπιστήμη", "en": "Knowledge", "zh": "知识"} > > You did not use any codepoint in the U+0080-U+00FF

[Python-ideas] Re: Deprecate misleading escapes in strings

2023-02-16 Thread Arusekk
W dniu 16.02.2023 o 17:55, David Mertz, Ph.D. pisze: Wow! That would break SO MUCH of the code I've written!  E.g.: translate = {"el": "ἐπιστήμη", "en": "Knowledge", "zh": "知识"} You did not use any codepoint in the U+0080-U+00FF range here. Are you sure the primary suggestion would break such

[Python-ideas] Re: Deprecate misleading escapes in strings

2023-02-16 Thread Eric V. Smith via Python-ideas
You should bring this up on https://discuss.python.org/c/ideas/6 , which is where ideas are discussed these days. This mailing list should be retired. I’ll mention that elsewhere. -- Eric > On Feb 16, 2023, at 9:57 AM, Arusekk wrote: > > Hi all! > > I was writing a tutorial on the

[Python-ideas] Re: Deprecate misleading escapes in strings

2023-02-16 Thread David Mertz, Ph.D.
Wow! That would break SO MUCH of the code I've written! E.g.: translate = {"el": "ἐπιστήμη", "en": "Knowledge", "zh": "知识"} On Thu, Feb 16, 2023 at 9:54 AM Arusekk wrote: > Hi all! > > I was writing a tutorial on the distinction between bytes and strings > and why it is important, when I

[Python-ideas] Re: Deprecate misleading escapes in strings

2023-02-16 Thread Barry
> On 16 Feb 2023, at 14:57, Arusekk wrote: > > Hi all! > > I was writing a tutorial on the distinction between bytes and strings > and why it is important, when I saw the root cause. People coming from > C, Perl, Python 2 and similar languages tend to misinterpret "\x90" for > b"\x90"

[Python-ideas] Deprecate misleading escapes in strings

2023-02-16 Thread Arusekk
Hi all! I was writing a tutorial on the distinction between bytes and strings and why it is important, when I saw the root cause.  People coming from C, Perl, Python 2 and similar languages tend to misinterpret "\x90" for b"\x90" often.  My idea is that Python could deprecate string literals