[Python-ideas] Non-English names in the turtle module.

Rustom Mody rustompmody at gmail.com
Sat Sep 5 08:42:54 CEST 2015



On Friday, September 4, 2015 at 12:56:33 PM UTC+5:30, Matthias Bussonnier 
wrote:
>
> Hi all, 
>
> Personal opinion, base by a bit of experience:
>

And my personal experience from the (an) other side:

Some students of mine worked to add devanagari to python: 

https://github.com/rusimody/l10Python
[Re-copying something here from a post on dev list
What I would wish to add is tl;dr at bottom
]

Here's an REPL-session to demo:
[Note १२३४५६७८९० is devanagari equivalent of 1234567890]
--------------------------------------------------
Python 3.5.0b2 (default, Jul 30 2015, 19:32:42)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> १२
12
>>> 23 == २३
True
>>> १२ + ३४
46
>>> १२ + 34
46
>>> "12" == "१२"
False
>>> 2 ≤ 3
True
>>> 2 ≠ 3
True
>>> (λ x: x+3)(4)
7
>>> # as a result of which this doesn't work... I did say they are kids!
...
>>> δ = 3
  File "<stdin>", line 1
    δ = 3
    ^
SyntaxError: invalid syntax
>>> {1,2,3} ∩ {2,3,4}
{2, 3}
>>> {1,2,3} ∪ {2,3,4}\{2, 3}
>>> {1,2,3} ∪ {2,3,4}
{1, 2, 3, 4}
>>> ¬ True
False
>>> Σ([1,2,3,4])
10
>>> 
----------------------------------------------
The last is actually more an embarrassment than the δ breaking since
they’ve *changed the lexer* to read the Σ when all that was required was
Σ = sum !!

In short... Kids!

tl;dr
For me (yes an educated Indian) English is a natural first language
However the idea that English is the *only* language is about as quaint the 
idea that the extent of the universe is as vast as a 100 kilometers with 
Garden of Eden in the center.
Our tiny experience with internationalizing python showed us that the lexer 
(at least) is terribly ASCII centric
My immediate wish-list: Modularize the lexer into a pre-lexer converting 
UTF-8 to unicode codepoint followed by a pure unicode 32-bit codepoint 
based lexer
My long-term wishlist (yeah somewhat unrealistic and utopian) for python 
4000 is the  increased awareness that the only reasonable international 
language 
is mathematics.

Or
http://blog.languager.org/2014/04/unicoded-python.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150904/03e742e3/attachment.html>


More information about the Python-ideas mailing list