Time we switched to unicode? (was Explanation of this Python language feature?)

Chris Angelico rosuav at gmail.com
Tue Mar 25 04:17:35 CET 2014

On Tue, Mar 25, 2014 at 2:00 PM, Rustom Mody <rustompmody at gmail.com> wrote:
> Yeah: Its 2014 (at least out here)...
> About time we started using unicode in earnest dont you think??

We do.

> Id like to see the following spellings corrected:
> lambda to λ
> in to ∈
> (preferably with the 'in' predicate and the 'in' in 'for' disambiguated)
> set([]) to ∅

The problems with these is not Unicode or a lack thereof, but keys. I
know how to type "lambda" on any keyboard I reach for; if it's a
full-sized QWERTY variant, I can type it without looking, and if it's
something else then I can peer at the thing and find the appropriate
five letters. (Phone keyboards are notoriously peer-worthy.) How do I
type λ? Do I have to memorize an alt-key sequence? Do I need to keep a
set of "language keywords" in a file somewhere so I can copy and
paste? Does my editor have to provide them?

What is really gained by using the short-hand? It becomes nigh
ungoogleable; yes, you can paste λ into Google and find out that it's
called lambda (and, if Python used that as a keyword, you could type
"λ python" into Google and get to the docs), but how do you figure out
which part of this to search for?


More likely you'd search for "sockets" or "sort" or maybe "key" or
"data", but you wouldn't expect to search for the symbol.

> And some parentheses disambiguation
> Internal ambiguity: Is '(...)' a paren? a function? a tuple?
> External ambiguity: {} in python vs in set theory

I don't know about the difference between {} in set theory and Python,
but the multiple uses of () actually boil down to two:

1) Grouping, which includes tuples; there's a special case whereby
grouping nothing makes a zero-item tuple, but everything else is just
the comma

2) Functions (both definition and call)

Disambiguating them might be of some small value, but since they're
the same in pretty much every language under the sun, it would feel
like syntactic salt: you have to use a different, and hard to type,
form of parenthesis for one (or even both!) of what ought to just be
simple brackets.

And what's the benefit? Shorter code, maybe. A few 2-6 letter
sequences that can become single characters. I can sympathize somewhat
with the set issue (because {} means an empty dict), although set() is
better than set([]); having a short form for that would be of some
advantage. But not if it's hard to type.


More information about the Python-list mailing list