Why has python3 been created as a seperate language where there is still python2.7 ?

Stefan Behnel stefan_ml at behnel.de
Wed Jun 27 09:44:53 EDT 2012


Christian Tismer, 27.06.2012 15:15:
> print, function or not, is not important enough to enforce a rewrite
> everywhere because of syntax error. That hides the real semantic
> changes which _are_ important.
> 
> So what I would have done is to let it work in an imperfect way. People
> then have the chance to rewrite with the print function, where it makes
> sense. But old packages which need to be changed, only because they
> have lots of
> 
>     if DEBUG:
>         print xxx, yyy, ...
> 
> could just stay unchanged or migrated later after the real meat has
> been properly tested etc.

Well, at least a SyntaxError makes it easy to find. And even if you don't
intend to use 2to3, you can still run it once to generate a patch for you
that only fixes up "print". In many cases, that will also make it work in
Py2 in such an "imperfect" way, either by doing the right thing already or
by printing out a tuple instead of a space separated string. If it's only
for debug output (which, as I said, would better be served by the logging
module), I can't see why that would be all that unacceptable.

Stefan




More information about the Python-list mailing list