Guido van Rossum wrote:
The parser is intentionally dumb so that the workings of the parser are easy to understand to users who care.
How about the grammar? Is it simple purely so the parser was easier to write? Personally, I have a theory that the one of the main reasons Python considered readable is because parsing it doesn't require more than one token of look ahead.
Good point -- the grammar is also intentionally dumb for usability (although there are a few cases where the grammar has to be complicated and a second pass is necessary to implement features that the dumb parser cannot handle, like disambiguating "x = y" from "x = y = z", and detecting keyword arguments). One of my personal theories (fed by a comment here by someone whose name don't recall right now) is that, unlike in other languages, the fact that so little happens at compile time is a big bonus to usability. --Guido van Rossum (home page: http://www.python.org/~guido/)