Compiler, ast and forwards/backwards compatibility

"Martin v. Löwis" martin at v.loewis.de
Wed Oct 8 16:20:06 EDT 2008


> My confusion starts with the fact that I'm not sure if all Python 2.4
> code is going to be syntactically valid 2.6 code.

That's not so much a matter of confusion, but of careful research.

I *think* all code that is syntactically correct in 2.4 is also
syntactically correct in 2.6 - but only because

  raise "Hello"

is still syntactically correct in 2.6 - it's a TypeError, not a
SyntaxError. The other case would be assignment to None, but that
was banned in 2.4 already.

> I guess 2.3 is valid
> 2.4 is valid 2.5

I think not so: assignment to None got disallowed, syntactically
(can't test 2.3, at the moment).

Regards,
Martin



More information about the Python-list mailing list