[Python-Dev] Python 2.x and 3.x use survey, 2014 edition

Chris McDonough chrism at plope.com
Wed Dec 17 01:45:07 CET 2014


On 12/16/2014 03:09 AM, Barry Warsaw wrote:
> On Dec 16, 2014, at 02:15 PM, Skip Montanaro wrote:
>
>> While he doesn't explicitly say so, I got the distinct impression reading
>> his recent blog post that he supports one source, not forked sources.
>
> I've ported a fair bit of code, both pure-Python and C extensions, both
> libraries and applications.  For successful library ports to Python 3 that
> need to remain Python 2 compatible, I would almost always recommend a single
> source, common dialect, no-2to3 approach.  There may be exceptions, but this
> strategy has proven effective over and over.  I generally find I don't need
> `six` but it does provide some nice conveniences that can be helpful.  With
> something like tox running your test suite, it doesn't even have to be painful
> to maintain.

I'll agree; with tox and some automated CI system like travis or jenkins 
or whatever, once you've done the port, it's only a minor nuisance to 
maintain a straddled 2/3 codebase.  Programming in only the subset still 
isn't much fun, but maintenance is slightly easier than I expected it to 
be.  "Drive by" contributions become slightly harder to accept because 
they often break 3 compatibility, and contributors are often unable or 
unwilling to install all the required versions that are tested by tox.

- C



More information about the Python-Dev mailing list