I am aware of this statement - There should be one-- and preferably only one --obvious way to do it. So I do expect to get a bunch of downvotes. However, I hope to get some constructive feedback even if the suggestion is not welcomed. I have written some code to test adding keywords and builtins in Chinese after changing Grammar/python.gram
. (Keywords and builtins are subject to change/poll)
make regen-keyword
make regen-pegen
make
I read this discuss.python.org/t/lets-make-as-alternative-keyword-for-lambda/22225/3
regarding some drawbacks of having alternate keywords. This does break some existing code, but because it’s a different script, there is less chance of collision. This could cause more collisions in languages that use a similar Latin based script. (e.g., if may mean something else in another lanugage). It might also introduce additional security concerns, but I have not investigated these implications. There are also better ways to implement what I did. (e.g., a mapping of English to a list of alternate languages while going through the rules). Last, there are probably performance implications, but this is just a test.
The diff is here: https://pastebin.com/wPN9ZA6Z
A simple unittest (which pass) is here (not comprehensive): https://pastebin.com/m73gtdgw
(I know i and j can be in unicode, but this would be how I prefer to write that part of the code)
I’m not sure if this will change usage patterns, as currently all python developers know English keywords. However, I do somehow like reading the new code.
If this (as I expect) gets rejected, is it still possible to develop this on a fork as this is (mostly) a superset of python and see if there is any interest in usage?