Unicode in Python

Steven D'Aprano steve at pearwood.info
Wed Apr 23 01:52:33 EDT 2014


On Tue, 22 Apr 2014 22:31:41 -0700, Rustom Mody wrote:

> Chris Angelico wrote:
>> it's impossible for most people to type (and programming with a palette
>> of arbitrary syntactic tokens isn't my idea of fun)...
> 
> Where's the suggestion to use a "palette of arbitrary tokens" ?
> 
> I just tried a greek keyboard; ie do
> $ setxkbmap -option "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
> -layout "us,gr"
> 
> Thereafter typing
> abcdefghijklmnopqrstuvwxyz
> after a Shift-Alt
> gives
> αβψδεφγηιξκλμνοπ;ρστθωςχυζ
> 
> One more Shift-Alt and back to roman
> 
> IOW the extra typing cost for greek letters is negligible over the
> corresponding roman ones


25 Unicode characters down, 1114000+ to go :-)

There's not just the keyboard mapping. There's the mental cost of knowing 
which keyboard mapping you need ("is it Greek, Hebrew, or maths 
symbols?"), the cost of remembering the mapping from the keys you see on 
the keyboard to the keys they are mapped to ("is Ω mapped to O or W?") 
and so forth. If you know lambda-calculus, you might associate λ with 
functions, but if you don't, it's as obfuscated as associating Ч with 
raising exceptions.

if not isinstance(obj, int):
    ЧTypeError("expected an int, got %r" % type(obj))




-- 
Steven



More information about the Python-list mailing list