<div class="gmail_quote">On 23 September 2012 23:57, Ian Kelly <span dir="ltr"><<a href="mailto:ian.g.kelly@gmail.com" target="_blank">ian.g.kelly@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5">On Sun, Sep 23, 2012 at 4:24 PM, Joshua Landau<br>
<<a href="mailto:joshua.landau.ws@gmail.com">joshua.landau.ws@gmail.com</a>> wrote:<br>
> The docs describe identifiers to have this grammar:<br>
><br>
> identifier   ::=  xid_start xid_continue*<br>
> id_start     ::=  <all characters in general categories Lu, Ll, Lt, Lm, Lo,<br>
> Nl, the underscore, and characters with the Other_ID_Start property><br>
> id_continue  ::=  <all characters in id_start, plus characters in the<br>
> categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property><br>
> xid_start    ::=  <all characters in id_start whose NFKC normalization is in<br>
> "id_start xid_continue*"><br>
> xid_continue ::=  <all characters in id_continue whose NFKC normalization is<br>
> in "id_continue*"><br>
><br>
> So I would assume that<br>
>     exec("a{} = None".format(char))<br>
> would be valid if<br>
>    unicodedata.normalize("NFKC", char)  == "1"<br>
> as<br>
>    exec("a1 = None")<br>
> is valid.<br>
><br>
> BUT "aš = None" is not valid*.<br>
><br>
> *a<superscript 1>, accessible through <ALT-GR>+1 if your keyboard's set up<br>
> to do that stuff.<br>
>On Sun, Sep 23, 2012 at 4:24 PM, Joshua Landau<div class="h5"><<a href="mailto:joshua.landau.ws@gmail.com">joshua.landau.ws@gmail.com</a>> wrote:</div><div class="h5">> The docs describe identifiers to have this grammar:</div>

<div class="h5">></div><div class="h5">> identifier   ::=  xid_start xid_continue*</div><div class="h5">> id_start     ::=  <all characters in general categories Lu, Ll, Lt, Lm, Lo,</div><div class="h5">> Nl, the underscore, and characters with the Other_ID_Start property></div>

<div class="h5">> id_continue  ::=  <all characters in id_start, plus characters in the</div><div class="h5">> categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property></div><div class="h5">> xid_start    ::=  <all characters in id_start whose NFKC normalization is in</div>

<div class="h5">> "id_start xid_continue*"></div><div><br></div>
> Thank you for your times.<br>
<br>
</div></div>Or if you don't have a keyboard for that, you can do the same thing via:<br>
<br>
exec("x\u00b9 = None")  # U+00B9 is superscript 1<br>
<br>
On the other hand, this does work:<br>
<br>
exec("x\u2071 = None")  # U+2071 is superscript i<br>
<br>
So it seems to be only an issue with superscript and subscript digits.<br>
 Looks like a compiler bug to me.<br></blockquote><div><br></div><div>W007! Another compiler bug!</div><div><br></div><div>Thanks for finding one that works. I can confirm that the snippet sets "xi", like the docs claim. Hence, yes, this does look like a compiler bug. I'll post it on the tracker and try and make a test that catches the rest if there are any.</div>

</div>