[Python-Dev] What it takes to change a single keyword. (original) (raw)
Yaşar Arabacı yasar11732 at gmail.com
Sun Oct 2 18:59:48 CEST 2011
- Previous message: [Python-Dev] What it takes to change a single keyword.
- Next message: [Python-Dev] What it takes to change a single keyword.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 <ncoghlan at gmail.com> yazdı:
2011/10/1 "Martin v. Löwis" <martin at v.loewis.de>: >> 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 at gmail.com | Brisbane, Australia
-- http://yasar.serveblog.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20111002/4f3004e5/attachment.html>
- Previous message: [Python-Dev] What it takes to change a single keyword.
- Next message: [Python-Dev] What it takes to change a single keyword.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]