So, what's the real story on Python 2 vs Python 3?

Dan Stromberg drsalists at gmail.com
Fri Dec 27 06:29:40 CET 2013


On Thu, Dec 26, 2013 at 9:04 PM, Travis McGee <nobody at nowhere.com> wrote:
> What's the deal? If I want to make a distributable software package, should
> it be 2 or 3? Enquiring minds want to know.

3.x alone isn't a bad option, but it doesn't really have to be an
either-or decision.  That is, even pretty substantial code bases can
run on both, without any 2to3 or 3to2.

Personally, I'd think very carefully before committing to a dependency
that's still 2.x-only today.

EG, when I was looking for a 3.x version of pygtk, it turned out that
pygtk was being replaced by something called "gobject", which runs on
both 2.x and 3.x.  I happily made my pygtk scripts use gobject, and
now they're portable between 2.x and 3.x - there was even a script
provided that made most of the changes for me.

Here's a link to a presentation I did at my local Python User Group
about writing code to run on both 2.x and 3.x:
http://stromberg.dnsalias.org/~dstromberg/Intro-to-Python/

HTH



More information about the Python-list mailing list