Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:not': 0.03; 'character,': 0.09; 'subject: [': 0.09; 'subject:module': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '(assuming': 0.16; '110': 0.16; 'backslash': 0.16; 'escapes': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'names?': 0.16; 'subject:Unicode': 0.16; 'tab': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'cc:addr:python.org': 0.22; 'unicode': 0.24; 'cc:2**0': 0.24; 'somewhere': 0.26; 'header:In-Reply-To:1': 0.27; 'external': 0.29; 'am,': 0.29; 'character': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'usually': 0.31; "d'aprano": 0.31; 'names.': 0.31; 'steven': 0.31; 'them?': 0.31; 'anyone': 0.31; 'figure': 0.32; 'quite': 0.32; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'in.': 0.36; 'module.': 0.36; 'being': 0.38; 'loss': 0.38; 'easiest': 0.38; 'itself': 0.39; 'either': 0.39; 'how': 0.40; 'even': 0.60; 'no.': 0.61; 'such': 0.63; 'mar': 0.68; 'combining': 0.68; 'capital': 0.73; '2015': 0.84; 'escapes,': 0.84; "they'd": 0.84; 'to:none': 0.92; 'subject:Auto': 0.93; 'enhancement': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=rYNGkXcd6d5Q7t1oybxvQkhJ75LR/C0ExUh/gl5Irrg=; b=oAnHveCZFr+NOI8+SFSbYgTXaC3yuuwoN6lTlNxFzuRuoj76uVzS72jLo1lMYDmr/R TcxCJrQ+gV6H5zsru9BDDe4gKjBzJKSPqDAccnidnyKSVbZjxFDtmEfIl0j6Vd2cBzHE xAQc6gDEk8HMahyGXJJfJ1Lfx0VP0RYQ5Ivzpayvw1OrXTfzD3XYv7fbyksdqYq8tULw WT8GhqYvcEGbp5pC6uX7fg0vEz/ywfGCrvdeunHrBuCj+cupuj3NpPO7PUiMCIPLH8Ll tGGe31KXU0UYeoIm6QG0aX1dn89UUD8YF9czunfLdPUfSlcZQ0ynb4UzYkTKWVJ42zcb WdVQ== MIME-Version: 1.0 X-Received: by 10.50.131.196 with SMTP id oo4mr2446608igb.2.1426637179950; Tue, 17 Mar 2015 17:06:19 -0700 (PDT) In-Reply-To: <5508b8f3$0$13014$c3e8da3$5496439d@news.astraweb.com> References: <18705a55-6b0a-4b55-99ab-479c19566e1a@googlegroups.com> <5508b8f3$0$13014$c3e8da3$5496439d@news.astraweb.com> Date: Wed, 18 Mar 2015 11:06:19 +1100 Subject: Re: Auto-completion of Unicode names [was why not module name?] From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1426637189 news.xs4all.nl 2856 [2001:888:2000:d::a6]:60102 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87656 On Wed, Mar 18, 2015 at 10:29 AM, Steven D'Aprano wrote: > Speaking of tab completion, would anyone be interested in being able to > auto-complete \N{...} unicode character names? I'm considering that as an > enhancement to my tabhistory module. > > Python supports \N{...} backslash escapes in Unicode strings, so we can > write things like: > > py> print(u"\N{CYRILLIC CAPITAL LETTER ZE WITH DESCENDER}") > =D2=98 > > > There are currently somewhere in the vicinity of 110 thousand such names. Not from me, no. I don't usually use \N escapes - it's usually easiest to do an external search to figure out the code point, and then either paste in the character itself (assuming it's not a combining character, or whitespace, or something, where the loss of clarity would be a problem), or just use a \u or \U escape. If I knew the names perfectly, then I might use \N escapes, but even with tab completion, they'd be quite slow to key in. How many people actually use \N escapes and hand-enter them? ChrisA