Using non-ascii symbols

Steven D'Aprano steve at REMOVETHIScyber.com.au
Tue Jan 24 06:56:01 EST 2006


On Tue, 24 Jan 2006 04:09:00 +0100, Christoph Zwerschke wrote:

> On the page http://wiki.python.org/moin/Python3%2e0Suggestions
> I noticed an interesting suggestion:
> 
> "These operators ≤ ≥ ≠ should be added to the language having the 
> following meaning:
> 
>        <= >= !=
> 
> this should improve readibility (and make language more accessible to 
> beginners).
> 
> This should be an evolution similar to the digraphe and trigraph 
> (digramme et trigramme) from C and C++ languages."
> 
> How do people on this group feel about this suggestion?
> 
> The symbols above are not even latin-1, you need utf-8.
> 
> (There are not many usefuls symbols in latin-1. Maybe one could use × 
> for cartesian products...)

Or for multiplication :-)

 
> And while they are better readable, they are not better typable (at 
> least with most current editors).
> 
> Is this idea absurd or will one day our children think that restricting 
> to 7-bit ascii was absurd?
> 
> Are there similar attempts in other languages? I can only think of APL, 
> but that was a long time ago.

My earliest programming was on (classic) Macintosh, which supported a
number of special characters including ≤ ≥ ≠ with the obvious
meanings. They were easy to enter too: the Mac keyboard had (has?) an
option key, and holding the option key down while typing a character would
enter a special character. E.g. option-s gave Greek sigma, option-p gave
pi, option-less-than gave ≤, and so forth. Much easier than trying to
memorize character codes.

I greatly miss the Mac's ease of entering special characters, and I miss
the ability to use proper mathematical symbols for (e.g.) pi, not equal,
and so forth.

> Once you open your mind for using non-ascii symbols, I'm sure one can 
> find a bunch of useful applications. Variable names could be allowed to 
> be non-ascii, as in XML. Think class names in Arabian... Or you could 
> use Greek letters if you run out of one-letter variable names, just as 
> Mathematicians do. Would this be desirable or rather a horror scenario? 
> Opinions?

I think the use of digraphs like != for not equal is a poor substitute for
a real not-equal symbol. I think the reliance of 7-bit ASCII is horrible
and primitive, but without easier, more intuitive ways of entering
non-ASCII characters, and better support for displaying non-ASCII
characters in the console, I can't see this suggestion going anywhere.



-- 
Steven.




More information about the Python-list mailing list