Edward K Ream schreef: >> There are a tool called "2to3" that translates things like "print foo" to >> print(foo). > > The point of my original post was that if I want to maintain a common code > base the tool must translate 'print foo' to 'print2(foo)'.
At first sight it seems to me that it's pretty straightforward to translate print(foo) to print2(foo) once "2to3" has done its job. It looks your main issue is that you're complaining that Python 3000 is going to break things in a non-backward compatible way. If you want to change that, you're going to be fighting an uphill battle, as this quote from PEP 3000 illustrates: "We need a meta-PEP to describe the compatibility requirements. Python 3000 will break backwards compatibility. There is no requirement that Python 2.9 code will run unmodified on Python 3.0. I'm not sure whether it is reasonable to require that Python 2.x code can be mechanically translated to equivalent Python 3.0 code; Python's dynamic typing combined with the plans to change the semantics of certain methods of dictionaries, for example, would make this task really hard. However, it would be great if there was some tool that did at least an 80% job of translation, pointing out areas where it wasn't sure using comments or warnings. Perhaps such a tool could be based on something like Pychecker." -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven -- http://mail.python.org/mailman/listinfo/python-list