[Python-ideas] Non-ASCII in Python syntax? [was: Null coalescing operator]

Stephen J. Turnbull turnbull.stephen.fw at u.tsukuba.ac.jp
Sun Oct 30 14:59:06 EDT 2016


Paul Moore writes:

 > They are on the keyboard. The £ sign is shift-3, the € sign uses the
 > AltGr key (which is woefully underused on the standard UK keyboard
 > driver - accented letters *should* be available using it :-()

OMG.

 > Believe me, I've tried. But I should point out that I *don't* count
 > the "official" way (Alt plus typing the numeric code out on the
 > numeric keypad) as a viable option:

I don't either.

 > A question, though. On Linux, (pick your distribution, but ideally "it
 > doesn't matter")

It does matter, at least last I checked.  Different distros default to
different keyboard configurations.  And it definitely matters what
language you configure as your primary -- accented letters and
punctuation used in that language will use AltGr, while those that
aren't may require a mode switch or a COMPOSE-ACCENT-BASE sequence.

 > how would I type é, √, ☺ ? Assume any answer that starts with
 > "look up the numeric code" is unacceptable, as is anything that
 > only works in a specific application.

Because this is X11/Unix, the answer is "it depends."  (For math
symbols and emoji, the common denominator default would surely be
selection from a palette.)  I suspect if there was a popular
programming language that used a half-dozen non-ASCII characters, a
slew of applets to configure those characters onto the keymap would
arise quickly, and one of those that provided relative sane default
mappings would become TOOWTDI.  This is definitely possible, but at
the moment, aside from language-specific mappings we already have,
there's no obvious set of default characters that "everybody" needs.

So a consistent, discoverable system for Unix won't happen until
there's a bunch of non-ASCII everybody needs (and that can't be
treated algorithmically like smart quotes), and no programming
language will impose that until there's a consistent discoverable
system of non-ASCII keymaps. :-(


More information about the Python-ideas mailing list