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

Rustom Mody rustompmody at gmail.com
Sat Nov 25 07:41:03 EST 2017


On Saturday, November 25, 2017 at 6:03:52 PM UTC+5:30, Rustom Mody wrote:
> 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!¡!

I should mention also that some languages are even more advanced in their
jovialness regarding unicode tricks

Haskell:
GHCi, version 8.0.2: http://www.haskell.org/ghc/  :? for help
Prelude> let flag = 1
Prelude> let flag = 2
Prelude> flag == flag
False
Prelude> (flag, flag)
(2,1)
Prelude> 

Python3 is quite boring by contrast:

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
>>> flag = 1
>>> flag = 2
>>> flag == flag
True
>>> (flag, flag)
(2, 2)
>>>



More information about the Python-list mailing list