[Python-Dev] Needing help to change the grammar (original) (raw)

Harry (Thiago Leucz Astrizi) thiagoharry at riseup.net
Sun Apr 12 21:09:22 CEST 2009


-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Written by "Martin v. Löwis" <martin at v.loewis.de>:

Notice that Python source is represented in UTF-8 in the parser. It might be that the C source code has a different encoding, which would cause the strcmp to fail.

No, all the files in the surce code were already in UTF-8. My system is configured to treat UTF-8 as the default encoding. This is not an encoding problem.

Written by "Jack diederich" <jackdied at gmail.com>:

I love the idea (and most recently edited PEP 306) so here are a few suggestions;

Brazil has many python programmers so you might be able to make quick progress by asking them for volunteer time.

Yes, I have plans to ask for help in the brazilian Python mailing list when I finish to prepare the C source code for this project. Then I expect to receive help to translate the python modules for this new language. There's a lot of work to do.

To bug-hunt your technical problem: try switching the "not is" operator to include an underscore "notis." The python LL(1) grammar checker works for python but isn't robust, and does miss some grammar ambiguities. Making the operator a single word might reveal a bug in the parser.

Thanks for the advice, you almost guessed what went wrong. I made some tests and already discovered what's the problem. When I change Grammar/Grammar, Python/ast.c and Modules/parsermodule.c to transform "is not" in "not is", everything works fine and I create a new Python verson where "a is not None" is wrong and "a not is None" is right. But when I translate this to "não é", always happens a SyntaxError. So the probles is really in the grammar checker that can't handle some letters with accent.

Well, knowing where the problem is, I think that I can try to solve it by myself. Thanks again.

Please consider switching your students to 'real' python part way through the course. If they want to use the vast amount of python code on the internet as examples they will need to know the few English keywords.

Also - most python core developers are not native English speakers and do OK :) PyCon speakers are about 25% non-native English speakers and EuroPython speakers are about the reverse (my rough estimate - I'd love to see some hard numbers).

Yes, I know. To a more "serious" programmer, it's essential to have a basic understanding in english and would be better for him to start with the real Python. But my intent is not to substitute Python in Brazil, but to create a new language that could be learned easily by younger people for educational purposes. My intent is to show them how a computer software works. But surely I will warn my students that to take programming more seriously, it's important to learn how to program in some other language, like the original Python. But thanks for the advice.

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFJ4jrjmNGEzq1zP84RAvikAJ4k25vufyWWiDvj3HFZ7Q4M38zCjgCglBGC dPQTd7mBuswKbNstpJqRuFE= =xApj -----END PGP SIGNATURE-----



More information about the Python-Dev mailing list