metaperl schrieb: > --> python -i >>>> class = "algebra" > File "<stdin>", line 1 > class = "algebra" > ^ > SyntaxError: invalid syntax > > > 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? > > Also, I had a bug where I tried to set the attributes "user" and "pass" > in an object but "pass" would not work because it is a reserved word. > Again pass should be reserved in certain contexts but not others.
Most parsers are written in a way that makes keywords reserved, regardless of their occurrence. That is because it is way easier to do so. And the few reserved words won't matter usually. > Is Python 3k going to fix this sort of thing? Don't think so. Diez -- http://mail.python.org/mailman/listinfo/python-list