Benefits of unicode identifiers (was: Allow additional separator in identifiers)

Rustom Mody rustompmody at gmail.com
Sat Nov 25 07:33:40 EST 2017


On Friday, November 24, 2017 at 12:20:29 AM UTC+5:30, Mikhail V wrote:
> Ok, I personally could find some practical usage for that, but
> merely for fun. I doubt though that someone with less
> typographical experience and overall computer literacy could
> really make benefits even for personal usage.
> 
> So - fun is one benefit. And fun is important. But is that the
> idea behind it?

Are you under-estimating the fun-value? 

Python 3.5.3 (default, Sep 14 2017, 22:58:41) 
[GCC 6.3.0 20170406] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> python.el: native completion setup loaded
>>> A = 1
>>> Α = 2
>>> А = 3
>>> (A, Α, А)
(1, 2, 3)
>>> # And there are 5 other variations on this magic trick
>>> # Or if you prefer…
>>> A == Α
False
>>> 

Now compare with the boring spoilsport called python 2:

Python 2.7.13 (default, Jan 19 2017, 14:48:08) 
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> python.el: native completion setup loaded
>>> A = 1
>>> Α = 2
  File "<stdin>", line 1
    Α = 2
    ^
SyntaxError: invalid syntax
>>> 

Personally I feel that there should be a law against languages that disallow 
the creation of magic tricks!¡!



More information about the Python-list mailing list