What it takes to change a single keyword.
Hi, First of all, I am sincerely sorry if this is wrong mailing list to ask this question. I checked out definitions of couple other mailing list, and this one seemed most suitable. Here is my question: Let's say I want to change a single keyword, let's say import keyword, to be spelled as something else, like it's translation to my language. I guess it would be more complicated than modifiying Grammar/Grammar, but I can't be sure which files should get edited. I'am asking this, because, I am trying to figure out if I could translate keyword's into another language, without affecting behaviour of language. -- http://yasar.serveblog.net/
First of all, I am sincerely sorry if this is wrong mailing list to ask this question. I checked out definitions of couple other mailing list, and this one seemed most suitable. Here is my question:
In principle, python-list would be more appropriate, but this really is a border case. So welcome!
Let's say I want to change a single keyword, let's say import keyword, to be spelled as something else, like it's translation to my language. I guess it would be more complicated than modifiying Grammar/Grammar, but I can't be sure which files should get edited.
Hmm. I also think editing Grammar/Grammar should be sufficient. Try restricting yourself to ASCII keywords first; this just worked fine for me. Of course, if you change a single keyword, none of the existing Python code will work anymore. See for yourself by changing 'def' to 'fed' (say). Regards, Martin
2011/10/1 "Martin v. Löwis"
First of all, I am sincerely sorry if this is wrong mailing list to ask this question. I checked out definitions of couple other mailing list, and this one seemed most suitable. Here is my question:
In principle, python-list would be more appropriate, but this really is a border case. So welcome!
Let's say I want to change a single keyword, let's say import keyword, to be spelled as something else, like it's translation to my language. I guess it would be more complicated than modifiying Grammar/Grammar, but I can't be sure which files should get edited.
Hmm. I also think editing Grammar/Grammar should be sufficient. Try restricting yourself to ASCII keywords first; this just worked fine for me.
For any changes where that isn't sufficient, then http://docs.python.org/devguide/grammar.html provides a helpful list of additional places to check (and http://docs.python.org/devguide/compiler.html provides info on how it all hangs together). However, rather than *changing* the keywords, it would likely be better to allow *alternate* keywords to avoid the problem Martin mentioned with existing Python code failing to run (including the entire standard library). Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
Thanks to you both, I have made some progress on introducing my own keywords
to python interpreter. I think it is very kind of you to answer my question.
I think I can take it from here. Thanks again :)
02 Ekim 2011 05:42 tarihinde Nick Coghlan
2011/10/1 "Martin v. Löwis"
: First of all, I am sincerely sorry if this is wrong mailing list to ask this question. I checked out definitions of couple other mailing list, and this one seemed most suitable. Here is my question:
In principle, python-list would be more appropriate, but this really is a border case. So welcome!
Let's say I want to change a single keyword, let's say import keyword, to be spelled as something else, like it's translation to my language. I guess it would be more complicated than modifiying Grammar/Grammar, but I can't be sure which files should get edited.
Hmm. I also think editing Grammar/Grammar should be sufficient. Try restricting yourself to ASCII keywords first; this just worked fine for me.
For any changes where that isn't sufficient, then http://docs.python.org/devguide/grammar.html provides a helpful list of additional places to check (and http://docs.python.org/devguide/compiler.html provides info on how it all hangs together).
However, rather than *changing* the keywords, it would likely be better to allow *alternate* keywords to avoid the problem Martin mentioned with existing Python code failing to run (including the entire standard library).
Cheers, Nick.
-- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
Just Info on the links:
http://docs.python.org/devguide/compiler.html provides info on how it all hangs together).
Those: [1] http://docs.python.org/devguide/compiler.html#id3Skip Montanaro’s Peephole Optimizer Paper (http://www.foretec.com/python/workshops/1998-11/proceedings/papers/montanaro...) [Wang97] http://docs.python.org/devguide/compiler.html#id2Daniel C. Wang, Andrew W. Appel, Jeff L. Korn, and Chris S. Serra. The Zephyr Abstract Syntax Description Language. http://www.cs.princeton.edu/%7Edanwang/Papers/dsl97/dsl97.html In Proceedings of the Conference on Domain-Specific Languages, pp. 213–227, 1997. are a 404 Cheers, francis
Please file a bug about the dead links so we can fix/remove them. On Wed, Oct 5, 2011 at 13:29, Francisco Martin Brugue < francisco.martin@web.de> wrote:
Just Info on the links:
http://docs.python.org/**devguide/compiler.htmlhttp://docs.python.org/devguide/compiler.htmlprovides info on how it
all hangs together).
Those:
**Skip Montanaro’s Peephole Optimizer Paper (http://www.foretec.com/**
[1] <http://docs.python.org/**devguide/compiler.html#id3http://docs.python.org/devguide/compiler.html#id3 python/workshops/1998-11/**proceedings/papers/montanaro/**montanaro.htmlhttp://www.foretec.com/python/workshops/1998-11/proceedings/papers/montanaro... )
**Daniel C. Wang, Andrew W. Appel, Jeff L. Korn, and Chris S. Serra. The Zephyr Abstract Syntax Description Language. < http://www.cs.princeton.edu/%**7Edanwang/Papers/dsl97/dsl97.**htmlhttp://www.cs.princeton.edu/%7Edanwang/Papers/dsl97/dsl97.html> In Proceedings of the Conference on Domain-Specific Languages, pp. 213–227,
[Wang97] <http://docs.python.org/**devguide/compiler.html#id2http://docs.python.org/devguide/compiler.html#id2 1997.
are a 404
Cheers,
francis
______________________________**_________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/**mailman/listinfo/python-devhttp://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/**mailman/options/python-dev/** brett%40python.orghttp://mail.python.org/mailman/options/python-dev/brett%40python.org
On 10/06/2011 12:00 AM, Brett Cannon wrote:
Please file a bug about the dead links so we can fix/remove them.
it's done in http://bugs.python.org/issue13117 (and I've also tried with a patch). Cheers, francis
participants (5)
-
"Martin v. Löwis"
-
Brett Cannon
-
Francisco Martin Brugue
-
Nick Coghlan
-
Yaşar Arabacı