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

Paul Moore p.f.moore at gmail.com
Sun Oct 30 11:45:25 EDT 2016


On 30 October 2016 at 14:51, Stephen J. Turnbull
<turnbull.stephen.fw at u.tsukuba.ac.jp> wrote:
> Paul Moore writes:
>
>  > My point wasn't so much about dealing with the character set of
>  > Unicode, as it was about physical entry of non-native text. For
>  > example, on my (UK) keyboard, all of the printed keycaps are basically
>  > used.
>
> How do you type the pound sign and the Euro sign?  Are they on the UK
> keyboard?  Or are you not in the UK and don't need them?

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 :-()

>  > And yet, I can't even enter accented letters from latin-1 with a
>  > standard keypress, much less extended Unicode.
>
> I'm pretty sure you can,

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:

1. It only works for the current codepage, I believe.
2. It gets intercepted by applications (I just tried it here, in the
gmail webapp, and got dumped out of the site to a google search page,
I've no idea why).

> You probably have Control, Windows, Menu, Alt, and maybe a "function"
> key.  If you're lucky, one labelled AltGr for "Alternate Graphic" is
> the obvious suspect.  Some combination of the above probably allows
> entry of accented Latin-1 characters, miscellaneous Latin-1 (eg, sharp
> S), and a few oddballs (Greek letters, ligatures like oe, the
> leminiscate usually read infinity).

It doesn't, by default. Specialised programs can customise keypresses,
but I'd hate to teach Python to newcomers if I needed something like
that. (And by "newcomers" I'd include all of my work colleagues, who
are far from computer illiterate...)

> For Windows, it seems that Alt+decimal character codes, or hex Unicode
> followed by Alt+x are the built-in ways to enter characters not on
> your keyboard.  It's also possible to set up "Math Autocorrect" to
> automatically convert keysequences according to
> https://blogs.msdn.microsoft.com/murrays/2011/08/29/sans-serif-mathematical-symbols/
> but that's hardly obvious (although maybe it is if you're Dutch?)

And it's application specific - noted in the article, "One way any
character can be entered into Word or OneNote (but not into
PowerPoint, sigh) is"

> I have to wonder why so many people stick with a system that seems to
> hate its users. :-(

OT, but in my case, because it's very good at making a lot of the key
things you need to do easy. It's immensely hostile in many ways, but
typically if you're finding that to be the case, you're pretty clearly
doing something that's not part of the "core target audience". Like
console programs, Unicode outside a specific code page, etc. But if
you are sticking to the norm, it's great.

A question, though. On Linux, (pick your distribution, but ideally "it
doesn't matter") 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. I'm willing to accept a
need for a one-off configuration of some mapping table to get √, but
accented letters and "common" characters like smileys should really be
available by default. Assume a qwerty keyboard, something like UK or
US layout (because it's the English speakers who need the most help
remembering that the whole world isn't ASCII :-)) I doubt it's that
much easier than it is on Windows.

My ideal is that something like what I defined in the above paragraph
*is* the norm, for all computer users. It's just plain silly that
English speakers can't type café, or a German friend's correctly
spelled name, without effort.

Anyhow, this is way off topic now.

Paul


More information about the Python-ideas mailing list