<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 27, 2013 at 6:01 AM, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":1np" style="overflow:hidden">Why do we need yet another way of writing escape sequences?<br>
------------------------------<u></u>-----------------------------<br>
<br>
We don't need another one, we need a better one. U+xxxx is the standard Unicode notation, while existing Python escapes have various problems.</div></blockquote></div><br>The current situation with \u and \U escapes can hardly qualify as an obvious way to do it. There is nothing obvious about either \u limitation to four digits nor \U requirement to have eight. (I remember discovering that after first trying something like \u1FFFF, then \U1FFFF and then checking the reference manual to discover \U0001FFFF. I don't think my experience was unique.)</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I have a counter-proposal that may improve the situation: allow 4, 5, 6 or 8 hex digits after \U optionally surrounded by braces. When used without braces, maximal munch rule applies: the escape sequence ends at the first non-hex-digit. I would allow only upper-case A-F in 4-6 digits escapes to minimize the need for braces. </div>
</div>