Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #87656

Re: Auto-completion of Unicode names [was why not module name?]

References <18705a55-6b0a-4b55-99ab-479c19566e1a@googlegroups.com> <5508b8f3$0$13014$c3e8da3$5496439d@news.astraweb.com>
Date 2015-03-18 11:06 +1100
Subject Re: Auto-completion of Unicode names [was why not module name?]
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.506.1426637189.21433.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Mar 18, 2015 at 10:29 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> 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}")
> Ҙ
>
>
> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Auto-completion: why not module name? candide <c.candide@laposte.net> - 2015-03-16 09:23 -0700
  Re: Auto-completion: why not module name? Chris Angelico <rosuav@gmail.com> - 2015-03-17 03:40 +1100
  Re: Auto-completion: why not module name? Jonas Wielicki <jonas@wielicki.name> - 2015-03-16 17:54 +0100
  Re: Auto-completion: why not module name? Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-16 10:57 -0600
  Re: Auto-completion: why not module name? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-17 19:10 +1100
    Re: Auto-completion: why not module name? Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-03-17 12:22 +0000
      Re: Auto-completion: why not module name? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-18 09:54 +1100
  Auto-completion of Unicode names [was why not module name?] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-18 10:29 +1100
    Re: Auto-completion of Unicode names [was why not module name?] Chris Angelico <rosuav@gmail.com> - 2015-03-18 11:06 +1100
    Re: Auto-completion of Unicode names [was why not module name?] Dan Sommers <dan@tombstonezero.net> - 2015-03-18 01:07 +0000

csiph-web