Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'compiler': 0.05; 'identifier': 0.09; 'sep': 0.09; 'bug': 0.10; 'assume': 0.11; '*a,': 0.16; '::=': 0.16; 'char)': 0.16; 'digits.': 0.16; 'identifiers': 0.16; 'none"': 0.16; 'stuff.': 0.16; 'valid.': 0.16; 'wrote:': 0.17; 'keyboard': 0.22; 'seems': 0.23; 'header:In- Reply-To:1': 0.25; 'looks': 0.26; 'message-id:@mail.gmail.com': 0.27; 'accessible': 0.33; 'docs': 0.33; 'to:addr:python-list': 0.33; 'times.': 0.33; 'that,': 0.34; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'skip:u 20': 0.36; 'but': 0.36; 'characters': 0.36; 'thank': 0.36; 'subject: (': 0.36; 'does': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'skip:n 10': 0.63; 'to:name:python': 0.84; 'hand,': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=xEojGes3xNAIfVHREA+yAGBr59+5Z5efXo50B1BCoS4=; b=psxtoCAmuctw7CUf8AMGZWM3Z5TupQ/XWHzC8VoEaZMn6Vv9DvJEJZmj1yjNG7F78m rQnR70BFOf3BtEmlBgrF/9izjKJ4zsdPZjFGuik16HVTrvLY1uF7PGuQQgeF7UC3Em+T 4PUKU7zckjAXBCO2beu1kQhC5Arcafm/p7Ib9gA6aVodBMEFMQ/NEBQxzhIoBUevc2MY G8Ii19oDtok0aLBtfnYWkyc6UAdRO0DZSS8fPWg8e3BZim9kG3uJe028WUttt79y6G/h dTxU6+O8kzFp+wtWs5mA/qddmtjC4ydHGBy3P+Dup44Q5X6OO1uOsBLl9nEu2E7YdyaP QBBg== MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Sun, 23 Sep 2012 16:57:53 -0600 Subject: Re: Invalid identifier claimed to be valid by docs (methinks) To: Python Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348441105 news.xs4all.nl 6919 [2001:888:2000:d::a6]:37769 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29872 On Sun, Sep 23, 2012 at 4:24 PM, Joshua Landau wrote: > The docs describe identifiers to have this grammar: > > identifier ::=3D xid_start xid_continue* > id_start ::=3D Nl, the underscore, and characters with the Other_ID_Start property> > id_continue ::=3D categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property> > xid_start ::=3D "id_start xid_continue*"> > xid_continue ::=3D in "id_continue*"> > > So I would assume that > exec("a{} =3D None".format(char)) > would be valid if > unicodedata.normalize("NFKC", char) =3D=3D "1" > as > exec("a1 =3D None") > is valid. > > BUT "a=B9 =3D None" is not valid*. > > *a, accessible through +1 if your keyboard's set u= p > to do that stuff. > > Thank you for your times. Or if you don't have a keyboard for that, you can do the same thing via: exec("x\u00b9 =3D None") # U+00B9 is superscript 1 On the other hand, this does work: exec("x\u2071 =3D None") # U+2071 is superscript i So it seems to be only an issue with superscript and subscript digits. Looks like a compiler bug to me.