[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Please install /usr/bin/python2



On Sep 15, 2013, at 01:24 PM, anatoly techtonik wrote:

>I mean that generally it is hard to say what problems people face when
>trying to make the code running on both Python 3 and Python 2. My own
>experience shows that testing both is very burdensome no matter if you
>port app or start from scratch. Generally you should keep in mind all
>differences between both languages and that alone already hard.

YMMV of course, but the way I'd put it is that sometimes it's easy and
sometimes it's damn near impossible. ;)

If you're writing from scratch and target 2.7 and 3.3 (let's say) from the
start, then I think it's generally not that hard, assuming of course your
dependencies are available in both.  Most, though not all, of the stdlib stuff
that comes for free with 3.3 is available in some form or another in 2.7.
Yes, you have to keep in mind the language differences, and maybe your code
really requires some of the new features, but most code doesn't I suspect.

Porting existing code can be harder, but often is not that difficult, and more
and more popular code bases are getting ported all the time.  If your favorite
thing isn't available, write patches.  These days, I think it's a black mark
for an upstream to refuse good Python 3 porting patches.

Most critical of all is: be clear in your bytes vs. strings model and you're
probably closer to the "easy" side of the scale.

-Barry


Reply to: