Pep 3105: the end of print?

Fuzzyman fuzzyman at gmail.com
Fri Feb 16 10:17:26 EST 2007


On Feb 16, 2:54 pm, Steven D'Aprano
<s... at REMOVE.THIS.cybersource.com.au> wrote:
> On Fri, 16 Feb 2007 06:42:55 -0800, Fuzzyman wrote:
> > I mentioned the 2to3 translator- the goal of which is *precisely* to
> > allow you to write code that will run on Python 2.X and when
> > translated run under Python 3.0.
>
> Unfortunately, that is not a realistic goal for the 2to3 translator. The
> goal is to accurately translate 80% of Python code that needs changing,
> and issue warnings for the other 20%.
>

Right, but it *was* a stated aim of the translator when discussed on
Python-dev recently.

> > You then repeated the problem with the 'print' statement.
>
> > It may be true that you won't be able to write code that runs
> > untranslated on 2 and 3. That doesn't stop you writing code for Python
> > 2.X, then translating a version for Python 3. (Uhm... indeed that's
> > the point of 2to3.)
>
> > So you only have one codebase to maintain and you can still use
> > print...
>
> No, you have TWO sets of code. You have the code you write, and the code
> you have run through 2to3. Even if 2to3 gives you 100% coverage, which it
> won't, you still have two codebases.
>

Only one of which you maintain - if the translator works 100% (which I
accept may be unrealistic).

Fuzzyman
http://www.voidspace.org.uk/python/articles.shtml

> --
> Steven.





More information about the Python-list mailing list