Are Python's reserved words reserved in places they dont need to be?

Richard Brodie R.Brodie at rl.ac.uk
Tue Sep 12 10:53:12 EDT 2006


"metaperl" <metaperl at gmail.com> wrote in message 
news:1158072199.681163.212310 at p79g2000cwp.googlegroups.com...

> Why isn' t the parser smart enough to see that class followed by an
> identifier is used for class definition but class followed by equals is
> a simple assignment?

Because it's simpler to reserve words than worry about possible
ambiguities in all past and future use cases. If you could use it
as an identifier, it wouldn't be a reserved word by the normal
definition of the term. 





More information about the Python-list mailing list